Class: Bandwidth::Xml::Response
- Inherits:
-
Object
- Object
- Bandwidth::Xml::Response
- Defined in:
- lib/bandwidth/xml/response.rb
Overview
Root class for Bandwidth XML
Instance Method Summary collapse
-
#<<(verb) ⇒ Object
Add a verb to this response.
-
#initialize(verbs = nil) ⇒ Response
constructor
Initializer.
-
#push(*verbs) ⇒ Object
Add one or more verbs to this response.
-
#to_xml ⇒ Object
Return XML presentaion of this response.
Constructor Details
#initialize(verbs = nil) ⇒ Response
Initializer
9 10 11 |
# File 'lib/bandwidth/xml/response.rb', line 9 def initialize(verbs = nil) @verbs = verbs || [] end |
Instance Method Details
#<<(verb) ⇒ Object
Add a verb to this response
29 30 31 |
# File 'lib/bandwidth/xml/response.rb', line 29 def <<(verb) @verbs << verb end |
#push(*verbs) ⇒ Object
Add one or more verbs to this response
24 25 26 |
# File 'lib/bandwidth/xml/response.rb', line 24 def push(*verbs) @verbs.push(*verbs) end |
#to_xml ⇒ Object
Return XML presentaion of this response
14 15 16 17 18 19 20 21 |
# File 'lib/bandwidth/xml/response.rb', line 14 def to_xml() xml = Builder::XmlMarkup.new() xml.instruct!(:xml, :version=>'1.0', :encoding=>'UTF-8') xml.Response do @verbs.each {|verb| verb.to_xml(xml)} end xml.target!() end |