Class: Slash::Formats::PeanutsXML
- Inherits:
-
Object
- Object
- Slash::Formats::PeanutsXML
- Defined in:
- lib/slash/peanuts.rb
Instance Attribute Summary collapse
-
#from_xml_options ⇒ Object
Returns the value of attribute from_xml_options.
-
#response_type ⇒ Object
readonly
Returns the value of attribute response_type.
-
#to_xml_options ⇒ Object
Returns the value of attribute to_xml_options.
Instance Method Summary collapse
- #decode(data) ⇒ Object
- #encode(data) ⇒ Object
-
#initialize(response_type, from_xml_options = {}, to_xml_options = {}) ⇒ PeanutsXML
constructor
A new instance of PeanutsXML.
Constructor Details
#initialize(response_type, from_xml_options = {}, to_xml_options = {}) ⇒ PeanutsXML
Returns a new instance of PeanutsXML.
10 11 12 13 |
# File 'lib/slash/peanuts.rb', line 10 def initialize(response_type, = {}, = {}) @response_type = response_type @to_xml_options, @from_xml_options = , end |
Instance Attribute Details
#from_xml_options ⇒ Object
Returns the value of attribute from_xml_options.
8 9 10 |
# File 'lib/slash/peanuts.rb', line 8 def @from_xml_options end |
#response_type ⇒ Object (readonly)
Returns the value of attribute response_type.
7 8 9 |
# File 'lib/slash/peanuts.rb', line 7 def response_type @response_type end |
#to_xml_options ⇒ Object
Returns the value of attribute to_xml_options.
8 9 10 |
# File 'lib/slash/peanuts.rb', line 8 def @to_xml_options end |
Instance Method Details
#decode(data) ⇒ Object
19 20 21 |
# File 'lib/slash/peanuts.rb', line 19 def decode(data) response_type.from_xml(data, ) end |
#encode(data) ⇒ Object
15 16 17 |
# File 'lib/slash/peanuts.rb', line 15 def encode(data) data.to_xml(:string, ) end |