Class: Clickatell::API::CommandExecutor
- Defined in:
- lib/clickatell/api/command_executor.rb
Overview
Used to run commands agains the Clickatell gateway.
Instance Method Summary collapse
-
#execute(command_name, service, parameters = {}) ⇒ Object
Builds a command object and sends it using HTTP GET.
-
#initialize(authentication_hash, secure = false, debug = false) ⇒ CommandExecutor
constructor
A new instance of CommandExecutor.
Constructor Details
#initialize(authentication_hash, secure = false, debug = false) ⇒ CommandExecutor
Returns a new instance of CommandExecutor.
9 10 11 12 13 |
# File 'lib/clickatell/api/command_executor.rb', line 9 def initialize(authentication_hash, secure=false, debug=false) @authentication_hash = authentication_hash @debug = debug @secure = secure end |
Instance Method Details
#execute(command_name, service, parameters = {}) ⇒ Object
Builds a command object and sends it using HTTP GET. Will output URLs as they are requested to stdout when debugging is enabled.
18 19 20 21 22 |
# File 'lib/clickatell/api/command_executor.rb', line 18 def execute(command_name, service, parameters={}) request_uri = command(command_name, service, parameters) puts "[debug] Sending request to #{request_uri}" if @debug get_response(request_uri).first end |