examples/relation.rb in ncmb-ruby-client-0.1.3 vs examples/relation.rb in ncmb-ruby-client-0.1.4

- old
+ new

@@ -1,19 +1,25 @@ -$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) -$:.unshift(File.dirname(__FILE__)) +# frozen_string_literal: true + +$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) +$LOAD_PATH.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'] +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") +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")