Class: Fiona7::AttributeWriters::StringlistAsText

Inherits:
AttributeWriter show all
Defined in:
lib/fiona7/attribute_writers/stringlist_as_text.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/stringlist_as_text.rb', line 7

def call(value, claimed_type=nil)
  if self.attr_name.to_s == "channels"
    self.obj.set(:channels, value || [])
  else
    self.obj.set(self.attr_name, Helpers::JsonSerializer.new.call(value || []))
  end
end