Sha256: b36be92ffdf9d0f4e8b1a83482476d176046f99eecc215abd8f262ffa1dab752

Contents?: true

Size: 384 Bytes

Versions: 9

Compression:

Stored size: 384 Bytes

Contents

require 'fiona7/attribute_writers/attribute_writer'
require 'fiona7/attribute_writers/helpers/json_serializer'

module Fiona7
  module AttributeWriters
    class ReferencelistAsText < AttributeWriter
      def call(value, claimed_type=nil)
        ids = (value || []).map(&:to_s)
        self.obj.set(self.attr_name, Helpers::JsonSerializer.new.call(ids))
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
infopark_fiona7-1.6.1.1.5 lib/fiona7/attribute_writers/referencelist_as_text.rb
infopark_fiona7-1.6.1.1.1 lib/fiona7/attribute_writers/referencelist_as_text.rb
infopark_fiona7-1.6.1.1.0 lib/fiona7/attribute_writers/referencelist_as_text.rb
infopark_fiona7-1.5.5.5.1 lib/fiona7/attribute_writers/referencelist_as_text.rb
infopark_fiona7-1.5.5.5.0 lib/fiona7/attribute_writers/referencelist_as_text.rb
infopark_fiona7-1.5.5.4.1 lib/fiona7/attribute_writers/referencelist_as_text.rb
infopark_fiona7-1.5.5.4.0 lib/fiona7/attribute_writers/referencelist_as_text.rb
infopark_fiona7-1.5.5.3.1 lib/fiona7/attribute_writers/referencelist_as_text.rb
infopark_fiona7-1.5.4.3.0 lib/fiona7/attribute_writers/referencelist_as_text.rb