Class: Literal::Data
Constant Summary
Constants included from Types
Instance Method Summary collapse
- #dup(**attributes) ⇒ Object
-
#initialize ⇒ Data
constructor
A new instance of Data.
Methods inherited from Struct
__attributes__, attribute, #to_h
Methods included from Types
#_Any, #_Array, #_Boolean, #_Class, #_Enumerable, #_Float, #_Hash, #_Integer, #_Interface, #_Maybe, #_Set, #_Tuple, #_Union
Constructor Details
#initialize ⇒ Data
Returns a new instance of Data.
2 3 4 5 6 7 |
# File 'lib/literal/data.rb', line 2 def initialize(...) super @attributes.each(&:freeze) @attributes.freeze freeze end |
Instance Method Details
#dup(**attributes) ⇒ Object
9 10 11 |
# File 'lib/literal/data.rb', line 9 def dup(**attributes) self.class.new(**@attributes.merge(attributes)) end |