Class: Fauna::SetRef
- Inherits:
-
Object
- Object
- Fauna::SetRef
- Defined in:
- lib/fauna/objects.rb
Overview
A SetRef.
Reference: FaunaDB Special Types
Instance Attribute Summary collapse
-
#value ⇒ Object
The raw set hash.
Instance Method Summary collapse
-
#==(other) ⇒ Object
(also: #eql?)
Returns
trueifotheris a SetRef and contains the same value. -
#initialize(params = {}) ⇒ SetRef
constructor
Creates a new SetRef with the given parameters.
-
#to_hash ⇒ Object
Converts the SetRef to Hash form.
Constructor Details
#initialize(params = {}) ⇒ SetRef
Creates a new SetRef with the given parameters.
params-
Hash of parameters to build the SetRef with.
Reference: FaunaDB Special Types
79 80 81 |
# File 'lib/fauna/objects.rb', line 79 def initialize(params = {}) self.value = params end |
Instance Attribute Details
#value ⇒ Object
The raw set hash.
71 72 73 |
# File 'lib/fauna/objects.rb', line 71 def value @value end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
Returns true if other is a SetRef and contains the same value.
89 90 91 92 |
# File 'lib/fauna/objects.rb', line 89 def ==(other) return false unless other.is_a? SetRef value == other.value end |
#to_hash ⇒ Object
Converts the SetRef to Hash form.
84 85 86 |
# File 'lib/fauna/objects.rb', line 84 def to_hash { :@set => value } end |