Class: Pike13::CLI::Commands::Desk::RevenueCategory

Inherits:
Base
  • Object
show all
Defined in:
lib/pike13/cli/commands/desk/revenue_category.rb

Class Method Summary collapse

Instance Method Summary collapse

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



9
10
11
# File 'lib/pike13/cli/commands/desk/revenue_category.rb', line 9

def self.base_usage
  "desk revenue_categories"
end

Instance Method Details

#get(id) ⇒ Object



26
27
28
29
30
31
# File 'lib/pike13/cli/commands/desk/revenue_category.rb', line 26

def get(id)
  handle_error do
    result = Pike13::Desk::RevenueCategory.find(id)
    output(result)
  end
end

#listObject



15
16
17
18
19
20
21
22
# File 'lib/pike13/cli/commands/desk/revenue_category.rb', line 15

def list
  handle_error do
    result = with_progress("Fetching revenue categories") do
      Pike13::Desk::RevenueCategory.all
    end
    output(result)
  end
end