class Sfctl::Commands::Time::Connections::Get

Public Class Methods

new(options) click to toggle source
# File lib/sfctl/commands/time/connections/get.rb, line 9
def initialize(options)
  @options = options
  @pastel = Pastel.new(enabled: !@options['no-color'])
end

Public Instance Methods

execute(output: $stdout) click to toggle source
# File lib/sfctl/commands/time/connections/get.rb, line 14
def execute(output: $stdout)
  read_link_config

  if config.fetch(:connections).nil?
    output.puts @pastel.yellow('You have no connections. Please add them before continue.')
    return
  end

  print_connections(output)
rescue TTY::Config::ReadError
  error_message = 'Please initialize time before continue and ensure that your account authenticated.'
  output.puts @pastel.yellow(error_message)
end

Private Instance Methods

print_connections(output) click to toggle source
print_harvest_connection!(output, assignment_id) click to toggle source
print_header!(output, assignment_id) click to toggle source
print_toggl_connection!(output, assignment_id) click to toggle source