Class: NIFTY::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/NIFTY/responses.rb

Class Method Summary collapse

Class Method Details

.parse(options = {}) ⇒ Object

ニフティクラウドAPIのレスポンス解析クラス

@option options [String] :xml           解析対象のXML
@option options [Hash] :parse_options   xml-simpleの解析オプション
@return [Hash] レスポンスXML解析結果


9
10
11
12
13
14
15
16
# File 'lib/NIFTY/responses.rb', line 9

def self.parse(options = {})
  options = {
    :xml => "",
    :parse_options => { 'forcearray' => ['item', 'member'], 'suppressempty' => nil, 'keeproot' => false }
  }.merge(options)

  return response = XmlSimple.xml_in(options[:xml], options[:parse_options])
end