Class: ImmutableStruct

Inherits:
Object
  • Object
show all
Defined in:
lib/immutable_struct.rb

Constant Summary collapse

VERSION =
'1.0.2'

Class Method Summary collapse

Class Method Details

.new(*attrs) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/immutable_struct.rb', line 6

def self.new(*attrs)
  struct = Struct.new(*attrs)
  make_immutable!(struct)
  optionalize_constructor!(struct)
  extend_dup!(struct)
  struct
end