Sha256: b6756f2cf1c818b9c1fe55b833b68d64f19424d7789c53311030878bf97168f9

Contents?: true

Size: 425 Bytes

Versions: 2

Compression:

Stored size: 425 Bytes

Contents

module NCMB
  class Relation < Array
    include NCMB
    
    def initialize
      
    end
    
    def to_json(a = "")
      params = {
        "__op": "AddRelation",
      }
      params["objects"] = []
      self.each do |obj|
        params["objects"] << {
          "__type": "Pointer",
          "className": obj.ClassName,
          "objectId": obj.objectId
        }
      end
      params.to_json
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ncmb-ruby-client-0.1.3 lib/ncmb/relation.rb
ncmb-ruby-client-0.1.2 lib/ncmb/relation.rb