Class: Literal::Set
Defined Under Namespace
Classes: Generic
Instance Attribute Summary collapse
-
#__type__ ⇒ Object
readonly
Returns the value of attribute __type__.
-
#__value__ ⇒ Object
readonly
Returns the value of attribute __value__.
Instance Method Summary collapse
- #each ⇒ Object
- #freeze ⇒ Object
-
#initialize(value, type:) ⇒ Set
constructor
A new instance of Set.
Constructor Details
#initialize(value, type:) ⇒ Set
Returns a new instance of Set.
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/literal/set.rb', line 26 def initialize(value, type:) collection_type = Literal::Types::SetType.new(type) Literal.check(value, collection_type) do |c| c.fill_receiver(receiver: self, method: "#initialize") end @__type__ = type @__value__ = value @__collection_type__ = collection_type end |
Instance Attribute Details
#__type__ ⇒ Object (readonly)
Returns the value of attribute __type__.
38 39 40 |
# File 'lib/literal/set.rb', line 38 def __type__ @__type__ end |
#__value__ ⇒ Object (readonly)
Returns the value of attribute __value__.
38 39 40 |
# File 'lib/literal/set.rb', line 38 def __value__ @__value__ end |