Class: Mobitex::HTTPDelivery
- Inherits:
-
Object
- Object
- Mobitex::HTTPDelivery
- Defined in:
- lib/mobitex/delivery/http_delivery.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#settings ⇒ Object
Returns the value of attribute settings.
Instance Method Summary collapse
- #deliver!(message) ⇒ Object
-
#initialize(values) ⇒ HTTPDelivery
constructor
A new instance of HTTPDelivery.
Constructor Details
#initialize(values) ⇒ HTTPDelivery
Returns a new instance of HTTPDelivery.
9 10 11 12 13 14 15 |
# File 'lib/mobitex/delivery/http_delivery.rb', line 9 def initialize(values) self.settings = { :user => nil, :pass => nil, :return_response => false }.merge!(values) end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
7 8 9 |
# File 'lib/mobitex/delivery/http_delivery.rb', line 7 def response @response end |
#settings ⇒ Object
Returns the value of attribute settings.
6 7 8 |
# File 'lib/mobitex/delivery/http_delivery.rb', line 6 def settings @settings end |
Instance Method Details
#deliver!(message) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/mobitex/delivery/http_delivery.rb', line 17 def deliver!() @response = nil .sanitize! raw_response = connection.post('/send.php', { :user => settings[:user], :pass => settings[:pass], :type => .type, :from => .from, :number => .to, :text => .body, :ext_id => . }) @response = Response.parse(raw_response.body) settings[:return_response] ? @response : self end |