Class: HashedStruct

Inherits:
Object
  • Object
show all
Defined in:
lib/hashed_struct.rb,
lib/hashed_struct/version.rb

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.new(*fields) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/hashed_struct.rb', line 5

def self.new(*fields)
  Struct.new(*fields) do
    def initialize(options={})
      super(*options.values_at(*self.class.members))
    end
  end
end