Class: Literal::Data

Inherits:
Struct show all
Defined in:
lib/literal/data.rb

Constant Summary

Constants included from Types

Types::BooleanType

Instance Method Summary collapse

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

#initializeData

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