Class: Dato::Local::FieldType::Links
- Defined in:
- lib/dato/local/field_type/links.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Array
Class Method Details
.parse(ids, repo) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/dato/local/field_type/links.rb', line 7 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
16 17 18 |
# File 'lib/dato/local/field_type/links.rb', line 16 def to_hash(max_depth = 3, current_depth = 0) map { |item| item.to_hash(max_depth, current_depth) } end |