class Weekdone::Cli::Objective

Public Instance Methods

comments() click to toggle source
# File lib/weekdone/cli/command_objective.rb, line 38
def comments
  client = build_client

  objectives = client.listObjectiveComments(options[:objectiveid])
  Credential.write_credential(client.token_hash)
  Output.format(objectives, format: :json)
end
list() click to toggle source
# File lib/weekdone/cli/command_objective.rb, line 20
def list
  client = build_client

  params = {}
  params[:type] = options[:type] if not options[:type].nil?
  params[:departmentid] = options[:departmentid] if not options[:departmentid].nil?
  params[:teamid] = options[:teamid] if not options[:teamid].nil?
  params[:userid] = options[:userid] if not options[:userid].nil?
  params[:period] = options[:period] if not options[:period].nil?

  objectives = client.getAllObjectives(params)

  Credential.write_credential(client.token_hash)
  Output.format(objectives, format: :json)
end