Sha256: e940e271ca54d014b2bd9a3a9ad48d47b614603cce5ec1e99025b28b79ed5594
Contents?: true
Size: 745 Bytes
Versions: 2
Compression:
Stored size: 745 Bytes
Contents
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $:.unshift(File.dirname(__FILE__)) require 'rubygems' require 'ncmb' require 'yaml' yaml = YAML.load_file(File.join(File.dirname(__FILE__), '..', 'setting.yml')) NCMB.initialize application_key: yaml['application_key'], client_key: yaml['client_key'] Food = NCMB::DataStore.new 'Food' Basket = NCMB::DataStore.new('Basket') basket = Basket.new basket.foods = [] basket.foods << Food.new(name: "banana", type: "fruit") basket.foods << Food.new(name: "pear", type: "fruit") # relation = NCMB::Relation.new # relation << Food.new(name: "banana", type: "fruit", objectId: "test1") # relation << Food.new(name: "pear", type: "fruit", objectId: "test2") # puts basket.fields basket.save
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ncmb-ruby-client-0.1.3 | examples/relation.rb |
ncmb-ruby-client-0.1.2 | examples/relation.rb |