Class: FourInfo::Request
- Inherits:
-
Object
- Object
- FourInfo::Request
- Defined in:
- lib/request.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#message ⇒ Object
Returns the value of attribute message.
-
#number ⇒ Object
Returns the value of attribute number.
Instance Method Summary collapse
- #confirm(number) ⇒ Object
- #deliver_message(message, number) ⇒ Object
-
#initialize ⇒ Request
constructor
A new instance of Request.
- #unblock(number) ⇒ Object
Constructor Details
#initialize ⇒ Request
Returns a new instance of Request.
8 9 10 11 12 13 |
# File 'lib/request.rb', line 8 def initialize unless FourInfo.configured? raise "You need to configure FourInfo before using it!" end self.config = FourInfo.configuration end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
4 5 6 |
# File 'lib/request.rb', line 4 def config @config end |
#message ⇒ Object
Returns the value of attribute message.
6 7 8 |
# File 'lib/request.rb', line 6 def @message end |
#number ⇒ Object
Returns the value of attribute number.
5 6 7 |
# File 'lib/request.rb', line 5 def number @number end |
Instance Method Details
#confirm(number) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/request.rb', line 23 def confirm(number) self.number = FourInfo.internationalize(number) xml = template(:confirm).render(self) Response.new(perform(xml)) end |
#deliver_message(message, number) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/request.rb', line 15 def (, number) self.number = FourInfo.internationalize(number) self. = xml = template(:deliver).render(self) Response.new(perform(xml)) end |
#unblock(number) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/request.rb', line 30 def unblock(number) self.number = FourInfo.internationalize(number) xml = template(:unblock).render(self) Response.new(perform(xml)) end |