class Spreedly::Gateway
Attributes
credentials[R]
Public Class Methods
new(xml_doc)
click to toggle source
Calls superclass method
# File lib/spreedly/gateway.rb, line 9 def initialize(xml_doc) super init_credentials(xml_doc) end
new_list_from(xml_doc)
click to toggle source
# File lib/spreedly/gateway.rb, line 14 def self.new_list_from(xml_doc) gateways = xml_doc.xpath('.//gateways/gateway') gateways.map do |each| self.new(each) end end
Private Instance Methods
init_credentials(xml_doc)
click to toggle source
# File lib/spreedly/gateway.rb, line 22 def init_credentials(xml_doc) @credentials = {} xml_doc.xpath('.//credentials/credential').each do |each| @credentials[each.at_xpath('.//name').text] = each.at_xpath('.//value').text end end