Sha256: af1e59613ac3728e76659a7bbebe4ba6233123ea872a6e83c5ec988c144896e8

Contents?: true

Size: 493 Bytes

Versions: 3

Compression:

Stored size: 493 Bytes

Contents

require 'dry/struct'

module ROM
  # Simple data-struct
  #
  # By default mappers use this as the model
  #
  # @api public
  class Struct < Dry::Struct
    # Returns a short string representation
    #
    # @return [String]
    #
    # @api public
    def to_s
      "#<#{self.class}:0x#{(object_id << 1).to_s(16)}>"
    end

    # Return attribute value
    #
    # @param [Symbol] name The attribute name
    #
    # @api public
    def fetch(name)
      __send__(name)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rom-repository-1.0.0.beta3 lib/rom/struct.rb
rom-repository-1.0.0.beta2 lib/rom/struct.rb
rom-repository-1.0.0.beta1 lib/rom/struct.rb