Class: Rockstar::Session

Inherits:
Base
  • Object
show all
Defined in:
lib/rockstar/session.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Base

connection, fetch_and_parse, get_instance

Instance Attribute Details

#keyObject

Returns the value of attribute key.



3
4
5
# File 'lib/rockstar/session.rb', line 3

def key
  @key
end

#subscriberObject

Returns the value of attribute subscriber.



3
4
5
# File 'lib/rockstar/session.rb', line 3

def subscriber
  @subscriber
end

#usernameObject

Returns the value of attribute username.



3
4
5
# File 'lib/rockstar/session.rb', line 3

def username
  @username
end

Class Method Details

.new_from_xml(xml, doc = nil) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/rockstar/session.rb', line 6

def new_from_xml(xml, doc=nil)
  t       = Session.new()
  t.username  = (xml).at(:name).inner_html
  t.key   = (xml).at(:key).inner_html
  t.subscriber   = (xml).at(:subscriber).inner_html
  t
end