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

- old
+ new

@@ -1,18 +1,24 @@ -$:.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'] +) @push = NCMB::Push.new @push.immediateDeliveryFlag = true @push.target = ['ios'] -@push.message = "This is test message" -@push.deliveryExpirationTime = "3 day" +@push.message = 'This is test message' +@push.deliveryExpirationTime = '3 day' if @push.save - puts "Push save successful." + puts 'Push save successful.' else - puts "Push save faild." + puts 'Push save faild.' end