Method: Representable::Deserializer::Collection#call
- Defined in:
- lib/representable/deserializer.rb
#call(fragment) ⇒ Object
82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/representable/deserializer.rb', line 82 def call(fragment) collection = [] # this can be replaced, e.g. AR::Collection or whatever. fragment.each_with_index do |item_fragment, i| # add more per-item options here! next if @binding.evaluate_option(:skip_parse, item_fragment) collection << deserialize!(item_fragment, i) # FIXME: what if obj nil? end collection # with parse_strategy: :sync, this is ignored. end |