Class: Yoda::Store::Objects::SerializableSet
- Inherits:
-
Object
- Object
- Yoda::Store::Objects::SerializableSet
- Includes:
- MissingDelegatable, Serializable
- Defined in:
- lib/yoda/store/objects/serializable_set.rb
Instance Attribute Summary collapse
- #set ⇒ Set readonly
Instance Method Summary collapse
-
#initialize(els = nil, elements: nil) ⇒ SerializableSet
constructor
A new instance of SerializableSet.
- #to_h ⇒ Object
Methods included from Serializable
#==, #derive, #eql?, #hash, included, #to_json
Methods included from MissingDelegatable
#delegate_missing_target, included, #method_missing, #respond_to_missing?
Constructor Details
#initialize(els = nil, elements: nil) ⇒ SerializableSet
Returns a new instance of SerializableSet.
13 14 15 |
# File 'lib/yoda/store/objects/serializable_set.rb', line 13 def initialize(els = nil, elements: nil) @set = Set.new(els || elements) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Yoda::MissingDelegatable
Instance Attribute Details
#set ⇒ Set (readonly)
11 12 13 |
# File 'lib/yoda/store/objects/serializable_set.rb', line 11 def set @set end |
Instance Method Details
#to_h ⇒ Object
17 18 19 |
# File 'lib/yoda/store/objects/serializable_set.rb', line 17 def to_h { elements: set.to_a } end |