Class: NCMB::Push

Inherits:
Object show all
Includes:
NCMB
Defined in:
lib/ncmb/push.rb

Constant Summary

Constants included from NCMB

API_VERSION, DOMAIN, SCRIPT_API_VERSION, SCRIPT_DOMAIN

Instance Method Summary collapse

Methods included from NCMB

CurrentUser, initialize

Methods inherited from Object

#ClassName, #[], #call, #convert_params, #deletable?, #delete, #error, #fields, #method_missing, #path, #post, #put, #saved?, #set

Constructor Details

#initialize(params = {}) ⇒ Push

Returns a new instance of Push.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/ncmb/push.rb', line 7

def initialize(params = {})
  [:deliveryTime, :immediateDeliveryFlag, :target, :searchCondition, :message,
  :userSettingValue, :deliveryExpirationDate, :deliveryExpirationTime, :action, :title, :dialog,
  :badgeIncrementFlag, :badgeSetting, :sound, :contentAvailable, :richUrl].each do |name|
    params[name] = nil unless params[name]
  end
  @search_key = :search_condition
  @queries = {}
  @queries[@search_key] = []
  super('push', params)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NCMB::Object

Instance Method Details

#base_pathObject



19
20
21
# File 'lib/ncmb/push.rb', line 19

def base_path
  "/#{@@client.api_version}/#{@name}"
end