Class: Reactor::ResponseHandler::XmlAttribute
- Inherits:
-
Object
- Object
- Reactor::ResponseHandler::XmlAttribute
- Defined in:
- lib/reactor/tools/response_handler/xml_attribute.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
5 6 7 |
# File 'lib/reactor/tools/response_handler/xml_attribute.rb', line 5 def context @context end |
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/reactor/tools/response_handler/xml_attribute.rb', line 5 def response @response end |
Instance Method Details
#get(response, attribute) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/reactor/tools/response_handler/xml_attribute.rb', line 7 def get(response, attribute) @response = response @context = context name = attribute.name type = attribute.type method_name = "extract_#{type}" send(method_name, name) end |
#multiple(elem, attributes) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/reactor/tools/response_handler/xml_attribute.rb', line 19 def multiple(elem, attributes) values = {} attributes.each do |attribute| values[attribute.name] = get(elem, attribute) end values end |