Sha256: f22d5be5d316d368a04b01ca0255883fd220d3f6ede43262b73e766c50c31564

Contents?: true

Size: 455 Bytes

Versions: 5

Compression:

Stored size: 455 Bytes

Contents

# frozen_string_literal: true

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

5 entries across 5 versions & 1 rubygems

Version Path
ncmb-ruby-client-0.2.0 lib/ncmb/relation.rb
ncmb-ruby-client-0.1.7 lib/ncmb/relation.rb
ncmb-ruby-client-0.1.6 lib/ncmb/relation.rb
ncmb-ruby-client-0.1.5 lib/ncmb/relation.rb
ncmb-ruby-client-0.1.4 lib/ncmb/relation.rb