Class: Openfire::Session
- Inherits:
-
Object
- Object
- Openfire::Session
- Defined in:
- lib/openfire/session.rb
Instance Attribute Summary collapse
-
#creation_date ⇒ Object
Returns the value of attribute creation_date.
-
#host_address ⇒ Object
Returns the value of attribute host_address.
-
#host_name ⇒ Object
Returns the value of attribute host_name.
-
#last_action_date ⇒ Object
Returns the value of attribute last_action_date.
-
#node ⇒ Object
Returns the value of attribute node.
-
#presence_message ⇒ Object
Returns the value of attribute presence_message.
-
#presence_status ⇒ Object
Returns the value of attribute presence_status.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#resource ⇒ Object
Returns the value of attribute resource.
-
#secure ⇒ Object
Returns the value of attribute secure.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
-
#session_status ⇒ Object
Returns the value of attribute session_status.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Session
constructor
A new instance of Session.
Constructor Details
#initialize(attributes = {}) ⇒ Session
Returns a new instance of Session.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/openfire/session.rb', line 7 def initialize(attributes={}) time_attrs = ['creationDate', 'lastActionDate'] boolean_attrs = ['secure'] attributes.each do |k,v| if k == 'ressource' self.resource = v elsif time_attrs.include?(k) self.send("#{to_underscore(k)}=", Time.parse(v)) unless v.nil? elsif boolean_attrs.include?(k) self.send("#{to_underscore(k)}=", v == 'true') else self.send("#{to_underscore(k)}=", v) end end end |
Instance Attribute Details
#creation_date ⇒ Object
Returns the value of attribute creation_date.
3 4 5 |
# File 'lib/openfire/session.rb', line 3 def creation_date @creation_date end |
#host_address ⇒ Object
Returns the value of attribute host_address.
3 4 5 |
# File 'lib/openfire/session.rb', line 3 def host_address @host_address end |
#host_name ⇒ Object
Returns the value of attribute host_name.
3 4 5 |
# File 'lib/openfire/session.rb', line 3 def host_name @host_name end |
#last_action_date ⇒ Object
Returns the value of attribute last_action_date.
3 4 5 |
# File 'lib/openfire/session.rb', line 3 def last_action_date @last_action_date end |
#node ⇒ Object
Returns the value of attribute node.
3 4 5 |
# File 'lib/openfire/session.rb', line 3 def node @node end |
#presence_message ⇒ Object
Returns the value of attribute presence_message.
3 4 5 |
# File 'lib/openfire/session.rb', line 3 def @presence_message end |
#presence_status ⇒ Object
Returns the value of attribute presence_status.
3 4 5 |
# File 'lib/openfire/session.rb', line 3 def presence_status @presence_status end |
#priority ⇒ Object
Returns the value of attribute priority.
3 4 5 |
# File 'lib/openfire/session.rb', line 3 def priority @priority end |
#resource ⇒ Object
Returns the value of attribute resource.
3 4 5 |
# File 'lib/openfire/session.rb', line 3 def resource @resource end |
#secure ⇒ Object
Returns the value of attribute secure.
3 4 5 |
# File 'lib/openfire/session.rb', line 3 def secure @secure end |
#session_id ⇒ Object
Returns the value of attribute session_id.
3 4 5 |
# File 'lib/openfire/session.rb', line 3 def session_id @session_id end |
#session_status ⇒ Object
Returns the value of attribute session_status.
3 4 5 |
# File 'lib/openfire/session.rb', line 3 def session_status @session_status end |
#username ⇒ Object
Returns the value of attribute username.
3 4 5 |
# File 'lib/openfire/session.rb', line 3 def username @username end |