Class: OpenX::Services::Session
- Inherits:
-
Object
- Object
- OpenX::Services::Session
- Defined in:
- lib/openx/services/session.rb
Constant Summary collapse
- @@endpoint =
'/LogonXmlRpcService.php'
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #create(user, password) ⇒ Object
- #destroy ⇒ Object
-
#initialize(url) ⇒ Session
constructor
A new instance of Session.
Constructor Details
#initialize(url) ⇒ Session
Returns a new instance of Session.
7 8 9 10 11 |
# File 'lib/openx/services/session.rb', line 7 def initialize(url) @url = url @server = XMLRPC::Client.new2("#{@url}#{@@endpoint}") @id = nil end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/openx/services/session.rb', line 4 def id @id end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/openx/services/session.rb', line 4 def url @url end |
Instance Method Details
#create(user, password) ⇒ Object
13 14 15 16 |
# File 'lib/openx/services/session.rb', line 13 def create(user, password) @id = @server.call('logon', user, password) self end |
#destroy ⇒ Object
18 19 20 21 22 |
# File 'lib/openx/services/session.rb', line 18 def destroy @server.call('logoff', @id) @id = nil self end |