Class: SMSBox::XMLRequest
- Inherits:
-
Object
- Object
- SMSBox::XMLRequest
- Defined in:
- lib/sms_box/xml_request.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/sms_box/xml_request.rb', line 6 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/sms_box/xml_request.rb', line 5 def username @username end |
Instance Method Details
#command ⇒ Object
8 9 10 |
# File 'lib/sms_box/xml_request.rb', line 8 def command raise NotImplementedError.new 'XMLRequest needs to be subclassed' end |
#decorate_xml(root) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/sms_box/xml_request.rb', line 12 def decorate_xml(root) root.username username root.password password root.command command root end |
#to_xml ⇒ Object
19 20 21 22 23 24 |
# File 'lib/sms_box/xml_request.rb', line 19 def to_xml builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml| decorate_xml(xml) end builder.to_xml end |