Class: Fauna::SetRef

Inherits:
Object
  • Object
show all
Defined in:
lib/fauna/objects.rb

Overview

A SetRef.

Reference: FaunaDB Special Types

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#valueObject

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_hashObject

Converts the SetRef to Hash form.



82
83
84
# File 'lib/fauna/objects.rb', line 82

def to_hash
  { :@set => value }
end