Class: AutoExpreso::Client

Inherits:
Object
  • Object
show all
Includes:
DataUtils
Defined in:
lib/autoexpreso.rb

Constant Summary collapse

BASE_URL =
'https://tp-api.autoexpreso.com'
USER_AGENT =
"AutoExpreso-Rubygem/#{AutoExpreso::VERSION}"
ENDPOINTS =
{
  login: '/api/Auth/Login',
  account_summary: '/api/Account/GetAccountSummary'
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DataUtils

attributes, form_data, included, save_transactions

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client.



26
27
28
# File 'lib/autoexpreso.rb', line 26

def initialize(*args)
  @account = Hash.new
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



23
24
25
# File 'lib/autoexpreso.rb', line 23

def 
  @account
end

#jwt_headerObject

Returns the value of attribute jwt_header.



24
25
26
# File 'lib/autoexpreso.rb', line 24

def jwt_header
  @jwt_header
end

Instance Method Details

#account_details(json: false) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/autoexpreso.rb', line 35

def (json: false)
  if json
    puts JSON.pretty_generate()
  else
    ap 
  end
end

#login(email, password) ⇒ Object



30
31
32
33
# File 'lib/autoexpreso.rb', line 30

def (email, password)
  authenticate(email, password)
  
end