Class: Agave::Local::FieldType::Links

Inherits:
Array
  • Object
show all
Defined in:
lib/agave/local/field_type/links.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Array

#deep_stringify_keys

Class Method Details

.parse(ids, repo) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/agave/local/field_type/links.rb', line 6

def self.parse(ids, repo)
  items = if ids
            ids.map { |id| repo.find(id) }
          else
            []
          end
  new(items)
end

Instance Method Details

#to_hash(max_depth = 3, current_depth = 0) ⇒ Object



15
16
17
# File 'lib/agave/local/field_type/links.rb', line 15

def to_hash(max_depth = 3, current_depth = 0)
  map { |item| item.to_hash(max_depth, current_depth) }
end