class IdonethisCli::Command

Private Instance Methods

auth_client() click to toggle source
# File lib/idonethis_cli/command.rb, line 19
def auth_client
  @auth_client ||= IdonethisCli::Client::Auth.new
end
authenticated?() click to toggle source
# File lib/idonethis_cli/command.rb, line 30
def authenticated?
  if settings.oauth2_token
    true
  else
    cli.say("You are not authenticated. Please run 'idt authorize'")
    false
  end
end
cli() click to toggle source
# File lib/idonethis_cli/command.rb, line 11
def cli
  @cli ||= HighLine.new
end
settings() click to toggle source
# File lib/idonethis_cli/command.rb, line 15
def settings
  @settings ||= Settings.new
end
team_set?() click to toggle source
# File lib/idonethis_cli/command.rb, line 39
def team_set?
  if settings.team
    true
  else
    cli.say("You have not set a team. Please run 'idt team_set'")
    false
  end
end
token() click to toggle source

This token is used to access things

# File lib/idonethis_cli/command.rb, line 24
def token
  auth_client.token(settings.oauth2_token).tap do |token|
    settings.save_oauth2_token(token.to_hash)
  end
end