class LC::ArrayOp

Attributes

objects[RW]
operation[RW]

'{“myArray”: {“__op”: “Add”, “objects”: [“something”, “something else”] } }'

Public Class Methods

new(operation, objects) click to toggle source
# File lib/leancloud/datatypes.rb, line 218
def initialize(operation, objects)
  @operation = operation
  @objects = objects
end

Public Instance Methods

==(other)
Alias for: eql?
as_json(*a)
Alias for: to_h
eql?(other) click to toggle source
# File lib/leancloud/datatypes.rb, line 223
def eql?(other)
  self.class.equal?(other.class) &&
    operation == other.operation &&
    objects == other.objects
end
Also aliased as: ==
hash() click to toggle source
# File lib/leancloud/datatypes.rb, line 231
def hash
  operation.hash ^ objects.hash
end
to_h(*a) click to toggle source
# File lib/leancloud/datatypes.rb, line 235
def to_h(*a)
  {
      Protocol::KEY_OP => operation,
      Protocol::KEY_OBJECTS => @objects
  }
end
Also aliased as: as_json
to_json(*a) click to toggle source
# File lib/leancloud/datatypes.rb, line 243
def to_json(*a)
  to_h.to_json(*a)
end