Class: Txter::Gateway4info::Response

Inherits:
Txter::Gateway::Response show all
Defined in:
lib/gateway_4info.rb

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ Response

Returns a new instance of Response.



45
46
47
48
49
50
# File 'lib/gateway_4info.rb', line 45

def initialize(xml)
  gem 'hpricot'
  require 'hpricot'
  @xml  = xml
  @body = Hpricot.parse(xml)
end

Instance Method Details

#[](name) ⇒ Object



56
57
58
59
# File 'lib/gateway_4info.rb', line 56

def [](name)
  nodes = (@body/name)
  1 == nodes.size ? nodes.first : nodes
end

#confirmation_codeObject



65
66
67
# File 'lib/gateway_4info.rb', line 65

def confirmation_code
  self[:confcode].inner_text
end

#inspectObject



52
53
54
# File 'lib/gateway_4info.rb', line 52

def inspect
  @xml.to_s
end

#success?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/gateway_4info.rb', line 61

def success?
  'Success' == self['message'].inner_text
end