Module: WOTC::Client::Utils

Included in:
WOTC::Client
Defined in:
lib/wotc/client/utils.rb

Overview

Defines methods related to utils

Instance Method Summary collapse

Instance Method Details

#token_valid?Boolean

Trigger an api call to verify access_token is valid.

Returns:

  • (Boolean)


7
8
9
10
11
12
# File 'lib/wotc/client/utils.rb', line 7

def token_valid?
  user = get('user').body
  return true if user&.fetch("id")
rescue => e
  return false
end

#wotc_calculator(options = {}) ⇒ Object

Pre-qualify an application of WOTC status



15
16
17
18
# File 'lib/wotc/client/utils.rb', line 15

def wotc_calculator(options={})
  result = post('wotc/calculator', options)
  result.body == true
end