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


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

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


14
15
16
# File 'lib/spreedly/gateway_class.rb', line 14

def auth_modes
  @auth_modes
end

#payment_methodsObject (readonly)

Returns the value of attribute payment_methods


14
15
16
# File 'lib/spreedly/gateway_class.rb', line 14

def payment_methods
  @payment_methods
end

#regionsObject (readonly)

Returns the value of attribute regions


14
15
16
# File 'lib/spreedly/gateway_class.rb', line 14

def regions
  @regions
end

#supported_countriesObject (readonly)

Returns the value of attribute supported_countries


14
15
16
# File 'lib/spreedly/gateway_class.rb', line 14

def supported_countries
  @supported_countries
end

Class Method Details

.new_list_from(xml_doc) ⇒ Object


24
25
26
27
28
29
# File 'lib/spreedly/gateway_class.rb', line 24

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