Class: Pike13::CLI::Commands::Report::StaffMembers

Inherits:
Base
  • Object
show all
Includes:
Concerns::ReportingQuery
Defined in:
lib/pike13/cli/commands/report/staff_members.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Concerns::ReportingQuery

included

Methods inherited from Base

format_options, handle_argument_error, printable_commands

Methods included from ThorNestedSubcommand

included

Class Method Details

.base_usageObject

Override base_usage to match the actual subcommand registration



11
12
13
# File 'lib/pike13/cli/commands/report/staff_members.rb', line 11

def self.base_usage
  "report staff_members"
end

Instance Method Details

#queryObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/pike13/cli/commands/report/staff_members.rb', line 17

def query
  handle_error do
    params = build_query_params
    params[:fields] ||= %w[person_id full_name email role person_state]
    result = with_progress("Fetching staff members report") do
      Pike13::Reporting::StaffMembers.query(**params)
    end
    output(result)
  end
end