Sha256: c2d5250415961aa9226cfe6218f988c2bc47ca2a1fceed3b927b6ddfb11fb31e

Contents?: true

Size: 428 Bytes

Versions: 2

Compression:

Stored size: 428 Bytes

Contents

module Chronicle::Serialization
  class HashSerializer < Chronicle::Serialization::Serializer
    def serializable_hash
      @record.properties.transform_values do |v|
        if v.is_a?(Array)
          v.map{|record| HashSerializer.new(record).serializable_hash}
        elsif v.is_a?(Chronicle::Schema::Base)
          HashSerializer.new(v).serializable_hash
        else
          v
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chronicle-core-0.2.2 lib/chronicle/serialization/hash_serializer.rb
chronicle-core-0.2.1 lib/chronicle/serialization/hash_serializer.rb