Class: Fiona7::AttributeWriters::LinklistAsLinklist

Inherits:
AttributeWriter show all
Defined in:
lib/fiona7/attribute_writers/linklist_as_linklist.rb

Instance Method Summary collapse

Methods inherited from AttributeWriter

#initialize

Constructor Details

This class inherits a constructor from Fiona7::AttributeWriters::AttributeWriter

Instance Method Details

#call(value, claimed_type = nil) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/fiona7/attribute_writers/linklist_as_linklist.rb', line 7

def call(value, claimed_type=nil)
  links = (value || []).map do |link|
    Helpers::LinkSerializer.new(self.obj, self.klass).call(link)
  end

  self.obj.set(self.attr_name, links)
end