Class: OnSIP::Session
- Inherits:
-
Object
- Object
- OnSIP::Session
- Extended by:
- ClassMethods
- Defined in:
- lib/onsip/session.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
Instance Method Summary collapse
- #account ⇒ Object
- #id ⇒ Object
-
#initialize(attributes = {}) ⇒ Session
constructor
A new instance of Session.
- #user ⇒ Object
- #user_id ⇒ Object
Methods included from ClassMethods
create, process_create_session_response
Constructor Details
#initialize(attributes = {}) ⇒ Session
Returns a new instance of Session.
6 7 8 |
# File 'lib/onsip/session.rb', line 6 def initialize(attributes = {}) @attributes = Hashie::Mash.new attributes end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/onsip/session.rb', line 4 def attributes @attributes end |
Instance Method Details
#account ⇒ Object
22 23 24 |
# File 'lib/onsip/session.rb', line 22 def account @account ||= self.user.account end |
#id ⇒ Object
10 11 12 |
# File 'lib/onsip/session.rb', line 10 def id @attributes.SessionId end |
#user ⇒ Object
18 19 20 |
# File 'lib/onsip/session.rb', line 18 def user @user ||= User.read(self.user_id) end |
#user_id ⇒ Object
14 15 16 |
# File 'lib/onsip/session.rb', line 14 def user_id @attributes.UserId end |