Class: Metaforce::Login
- Inherits:
-
Object
- Object
- Metaforce::Login
- Defined in:
- lib/metaforce/login.rb
Instance Method Summary collapse
-
#initialize(username, password, security_token = nil) ⇒ Login
constructor
A new instance of Login.
-
#login ⇒ Object
Public: Perform the login request.
Constructor Details
#initialize(username, password, security_token = nil) ⇒ Login
Returns a new instance of Login.
3 4 5 |
# File 'lib/metaforce/login.rb', line 3 def initialize(username, password, security_token=nil) @username, @password, @security_token = username, password, security_token end |
Instance Method Details
#login ⇒ Object
Public: Perform the login request.
Returns a hash with the session id and server urls.
10 11 12 13 14 15 16 17 18 |
# File 'lib/metaforce/login.rb', line 10 def login response = client.request(:login) do soap.body = { :username => username, :password => password } end response.body[:login_response][:result] end |