Class: Pike13::CLI::Commands::Desk::PersonVisit
- Defined in:
- lib/pike13/cli/commands/desk/person_visit.rb
Class Method Summary collapse
-
.base_usage ⇒ Object
Override base_usage to match the actual subcommand registration.
Instance Method Summary collapse
Methods inherited from Base
format_options, handle_argument_error, printable_commands
Methods included from ThorNestedSubcommand
Class Method Details
.base_usage ⇒ Object
Override base_usage to match the actual subcommand registration
9 10 11 |
# File 'lib/pike13/cli/commands/desk/person_visit.rb', line 9 def self.base_usage "desk person_visits" end |
Instance Method Details
#list(person_id) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/pike13/cli/commands/desk/person_visit.rb', line 18 def list(person_id) validate_date_format([:from], "from") if [:from] validate_date_format([:to], "to") if [:to] handle_error do params = {} params[:from] = [:from] if [:from] params[:to] = [:to] if [:to] params[:event_occurrence_id] = [:event_occurrence_id] if [:event_occurrence_id] result = with_progress("Fetching visits for person #{person_id}") do Pike13::Desk::PersonVisit.all(person_id: person_id, **params) end output(result) end end |