lib/berkeley_library/tind/api/collection.rb
# Returns an array of collection tree roots, which can be traversed
# with {Collection#each_descendant}.
#
# @return [Array<Collection>] an array of top-level collections
Returns an array of collection tree roots, which can be traversed
with {Collection#each_descendant}.
Returns an array of collection tree roots which can be traversed with { Collection#each_descendant } .
def all_from_json(json)
            ensure_hash(json).map do |name, attrs|
              translations = attrs['translations']
              Collection.new(
                name,
                attrs['nb_rec'],
                all_from_json(attrs['children']),
                translations
              )
            end
          end
def all_from_json ( json ) ensure_hash ( json ) . map do | name , attrs | translations = attrs [ 'translations' ] Collection . new ( name , attrs [ 'nb_rec' ] , all_from_json ( attrs [ 'children' ] ) , translations ) end end
Returns an array of collection tree roots, which can be traversed
with {Collection#each_descendant}.
Returns an array of collection tree roots which can be traversed with { Collection#each_descendant } .
an array of top-level collections
an array of top - level collections
Array<Collection>
json
<not_specific>