Class: ClassyStruct::ClassyStructClass

Inherits:
Object
  • Object
show all
Includes:
CommonStruct
Defined in:
ext/classystruct.rb

Constant Summary

Constants included from CommonStruct

CommonStruct::DEFAULT_STRUCT_TYPE

Instance Method Summary collapse

Methods included from CommonStruct

#delete, #to_json, #to_struct

Instance Method Details

#lockObject

Convert ClassyStruct to Struct, thus locking it.



41
42
43
# File 'ext/classystruct.rb', line 41

def lock
  self.to_h.to_struct(Struct::STRUCT_TYPE)
end

#merge(other) ⇒ Object



36
37
38
# File 'ext/classystruct.rb', line 36

def merge other
  self.to_h.merge!(other.to_h).to_struct(STRUCT_TYPE)
end

#struct_typeObject



32
33
34
# File 'ext/classystruct.rb', line 32

def struct_type
  STRUCT_TYPE
end