class Nimbu::Endpoints::Login

Public Class Methods

new(options={}, &block) click to toggle source
Calls superclass method Nimbu::Endpoint::new
# File lib/nimbu-api/endpoints/login.rb, line 7
def initialize(options={}, &block)
  super

  require_authentication

  # fetch api token
  @response = post_request("/auth/login")
end

Public Instance Methods

require_authentication() click to toggle source
# File lib/nimbu-api/endpoints/login.rb, line 20
def require_authentication
  raise ArgumentError, 'A username and password is required in order to login' unless authenticated?
end
response() click to toggle source
# File lib/nimbu-api/endpoints/login.rb, line 16
def response
  @response
end