Class: Parse::Cloud::Function

Inherits:
Object
  • Object
show all
Defined in:
lib/parse/cloud.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(function_name) ⇒ Function

Returns a new instance of Function.



7
8
9
# File 'lib/parse/cloud.rb', line 7

def initialize(function_name)
  @function_name = function_name
end

Instance Attribute Details

#function_nameObject

Returns the value of attribute function_name.



5
6
7
# File 'lib/parse/cloud.rb', line 5

def function_name
  @function_name
end

Instance Method Details

#call(params = {}) ⇒ Object



15
16
17
18
19
# File 'lib/parse/cloud.rb', line 15

def call(params={})
  response = Parse.client.post(self.uri, params.to_json)
  result = response["result"]
  result
end

#uriObject



11
12
13
# File 'lib/parse/cloud.rb', line 11

def uri
  Protocol.cloud_function_uri(@function_name)
end