Class: Pike13::CLI::Commands::Report::EventOccurrences

Inherits:
Base
  • Object
show all
Includes:
Concerns::ReportingQuery
Defined in:
lib/pike13/cli/commands/report/event_occurrences.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/event_occurrences.rb', line 11

def self.base_usage
  "report event_occurrences"
end

Instance Method Details

#queryObject



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

def query
  handle_error do
    params = build_query_params
    params[:fields] ||= %w[event_occurrence_id event_name service_date enrollment_count capacity]
    result = with_progress("Fetching event occurrences report") do
      Pike13::Reporting::EventOccurrences.query(**params)
    end
    output(result)
  end
end