Sha256: 684df899a3dc2b1ef1914fe7811aa89fff1c08b6a31bbe03ca90827eecc7a453

Contents?: true

Size: 328 Bytes

Versions: 4

Compression:

Stored size: 328 Bytes

Contents

module Disposable
  class Twin
    # Twin that uses a hash to populate.
    #
    #   Twin.new(id: 1)
    module Struct
      def initialize(model, options={})
        super # call from_hash(options) # FIXME: this is wrong and already calls from_hash(options)

        from_hash(model.merge(options))
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
disposable-0.1.0 lib/disposable/twin/struct.rb
disposable-0.0.9 lib/disposable/twin/struct.rb
disposable-0.0.8 lib/disposable/twin/struct.rb
disposable-0.0.7 lib/disposable/twin/struct.rb