Class: Parse::ArrayOp
- Inherits:
-
Object
- Object
- Parse::ArrayOp
- Defined in:
- lib/parse/datatypes.rb
Instance Attribute Summary collapse
-
#objects ⇒ Object
Returns the value of attribute objects.
-
#operation ⇒ Object
‘{“myArray”: {“__op”: “Add”, “objects”: [“something”, “something else”] } }’.
Instance Method Summary collapse
- #as_json(*a) ⇒ Object
- #eql?(other) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(operation, objects) ⇒ ArrayOp
constructor
A new instance of ArrayOp.
- #to_json(*a) ⇒ Object
Constructor Details
#initialize(operation, objects) ⇒ ArrayOp
Returns a new instance of ArrayOp.
232 233 234 235 |
# File 'lib/parse/datatypes.rb', line 232 def initialize(operation, objects) @operation = operation @objects = objects end |
Instance Attribute Details
#objects ⇒ Object
Returns the value of attribute objects.
230 231 232 |
# File 'lib/parse/datatypes.rb', line 230 def objects @objects end |
#operation ⇒ Object
‘{“myArray”: {“__op”: “Add”, “objects”: [“something”, “something else”] } }’
229 230 231 |
# File 'lib/parse/datatypes.rb', line 229 def operation @operation end |
Instance Method Details
#as_json(*a) ⇒ Object
249 250 251 252 253 254 |
# File 'lib/parse/datatypes.rb', line 249 def as_json(*a) { Protocol::KEY_OP => operation, Protocol::KEY_OBJECTS => @objects } end |
#eql?(other) ⇒ Boolean Also known as: ==
237 238 239 240 241 |
# File 'lib/parse/datatypes.rb', line 237 def eql?(other) self.class.equal?(other.class) && operation == other.operation && objects == other.objects end |
#hash ⇒ Object
245 246 247 |
# File 'lib/parse/datatypes.rb', line 245 def hash operation.hash ^ objects.hash end |
#to_json(*a) ⇒ Object
256 257 258 |
# File 'lib/parse/datatypes.rb', line 256 def to_json(*a) as_json.to_json(*a) end |