Sha256: 58ff7fc18248c9af072b760d725d7b50607477f99694964a4ebd33fe6be3e5f8

Contents?: true

Size: 404 Bytes

Versions: 1

Compression:

Stored size: 404 Bytes

Contents

module Separatum
  module Converters
    class Hash2Object
      def call(*hashes)
        hashes.map do |hash|
          hash_copy = hash.symbolize_keys
          _klass = hash_copy.delete(:_klass).constantize
          instance = _klass.new
          hash_copy.symbolize_keys.each do |k, v|
            instance.send("#{k}=", v)
          end
          instance
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
separatum-0.1.0 lib/separatum/converters/hash2_object.rb