class OmniAuth::Hattrick::XmlParser

Attributes

doc[R]
manager_details[RW]
xml[R]

Public Class Methods

new(xml) click to toggle source
# File lib/omniauth-hattrick/xml_parser.rb, line 9
def initialize(xml)
  @doc = Nokogiri::XML(xml) 
  @manager_details = {}
end

Public Instance Methods

parse() click to toggle source
# File lib/omniauth-hattrick/xml_parser.rb, line 14
def parse
  add_user_id
  add_username
  manager_details
end

Private Instance Methods

add_user_id() click to toggle source
# File lib/omniauth-hattrick/xml_parser.rb, line 25
def add_user_id
  manager_details[:user_id] = doc.xpath('//UserId').text
end
add_username() click to toggle source
# File lib/omniauth-hattrick/xml_parser.rb, line 29
def add_username
  manager_details[:username] = doc.xpath('//Loginname').text
end