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
true
ifother
is 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
77 78 79 |
# File 'lib/fauna/objects.rb', line 77 def initialize(params = {}) self.value = params end |
Instance Attribute Details
#value ⇒ Object
The raw set hash.
69 70 71 |
# File 'lib/fauna/objects.rb', line 69 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.
87 88 89 90 |
# File 'lib/fauna/objects.rb', line 87 def ==(other) return false unless other.is_a? SetRef value == other.value end |
#to_hash ⇒ Object
Converts the SetRef to Hash form.
82 83 84 |
# File 'lib/fauna/objects.rb', line 82 def to_hash { :@set => value } end |