Class: Parse::Op::AddRelation
- Inherits:
-
Object
- Object
- Parse::Op::AddRelation
- Defined in:
- lib/parse/op/add_relation.rb
Instance Method Summary collapse
-
#initialize(*pointers) ⇒ AddRelation
constructor
A new instance of AddRelation.
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(*pointers) ⇒ AddRelation
Returns a new instance of AddRelation.
4 5 6 7 8 9 10 11 12 |
# File 'lib/parse/op/add_relation.rb', line 4 def initialize *pointers @pointers = pointers.map do |p| if p.is_a? Parse::Object p.pointer else p end end end |
Instance Method Details
#to_json(*args) ⇒ Object
14 15 16 |
# File 'lib/parse/op/add_relation.rb', line 14 def to_json *args %Q|{"__op":"AddRelation","objects":[#{@pointers.map(&:to_json).join(',')}]}| end |