Class: Spreedly::GatewayClass

Inherits:
Object
  • Object
show all
Includes:
Fields
Defined in:
lib/spreedly/gateway_class.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Fields

#field_hash, included, #initialize_fields

Constructor Details

#initialize(xml_doc) ⇒ GatewayClass

Returns a new instance of GatewayClass.



18
19
20
21
22
23
24
# File 'lib/spreedly/gateway_class.rb', line 18

def initialize(xml_doc)
  initialize_fields(xml_doc)
  init_supported_countries(xml_doc)
  init_regions(xml_doc)
  init_payment_methods(xml_doc)
  init_auth_modes(xml_doc)
end

Instance Attribute Details

#auth_modesObject (readonly)

Returns the value of attribute auth_modes.



16
17
18
# File 'lib/spreedly/gateway_class.rb', line 16

def auth_modes
  @auth_modes
end

#payment_methodsObject (readonly)

Returns the value of attribute payment_methods.



16
17
18
# File 'lib/spreedly/gateway_class.rb', line 16

def payment_methods
  @payment_methods
end

#regionsObject (readonly)

Returns the value of attribute regions.



16
17
18
# File 'lib/spreedly/gateway_class.rb', line 16

def regions
  @regions
end

#supported_countriesObject (readonly)

Returns the value of attribute supported_countries.



16
17
18
# File 'lib/spreedly/gateway_class.rb', line 16

def supported_countries
  @supported_countries
end

Class Method Details

.new_list_from(xml_doc) ⇒ Object



26
27
28
29
30
31
# File 'lib/spreedly/gateway_class.rb', line 26

def self.new_list_from(xml_doc)
  gateways = xml_doc.xpath('.//gateways/gateway')
  gateways.map do |each|
    self.new(each)
  end
end