Class: PennySMSMuncher::PennySMS::JSONRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/penny_sms.rb

Overview

DOES NOT WORK 2009-12-22

Instance Attribute Summary

Attributes inherited from Request

#api_key, #from_email, #phone_number, #response, #text, #url

Instance Method Summary collapse

Methods inherited from Request

#request, #send_sms

Constructor Details

#initialize(*args) ⇒ JSONRequest

Returns a new instance of JSONRequest.

Raises:

  • (NoMethodError)


107
108
109
110
111
112
113
# File 'lib/penny_sms.rb', line 107

def initialize(*args)
  raise NoMethodError, "JSONRequest not working. Figure it out though and let me know"
  @api_url = 'http://api.pennysms.com/jsonrpc'
  @rpc_method = 'send'
  @content_type = 'text/json'
  super
end

Instance Method Details

#templateObject



115
116
117
118
119
# File 'lib/penny_sms.rb', line 115

def template
  {:method => @rpc_method,
    :params => [api_key,from_email,phone_number,text]
  }.to_json
end