Class: Navigable::ImmutableStruct
- Inherits:
-
Struct
- Object
- Struct
- Navigable::ImmutableStruct
- Defined in:
- lib/navigable/immutable_struct.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(**args) ⇒ ImmutableStruct
constructor
A new instance of ImmutableStruct.
Constructor Details
#initialize(**args) ⇒ ImmutableStruct
Returns a new instance of ImmutableStruct.
11 12 13 14 15 |
# File 'lib/navigable/immutable_struct.rb', line 11 def initialize(**args) members.each { |key| args.fetch(key) } super(**args) freeze end |
Class Method Details
.new(*args, &block) ⇒ Object
6 7 8 |
# File 'lib/navigable/immutable_struct.rb', line 6 def new(*args, &block) super(*args, keyword_init: true, &block) end |