Class: RailsInteractive::CLI::Category

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/category.rb

Overview

Categories class for the interactive CLI module

Instance Method Summary collapse

Constructor Details

#initializeCategory

Returns a new instance of Category.



9
10
11
# File 'lib/cli/category.rb', line 9

def initialize
  @categories = YAML.load_file("#{__dir__}/config/categories.yml").uniq
end

Instance Method Details

#allObject



13
14
15
# File 'lib/cli/category.rb', line 13

def all
  @categories.sort_by { |category| category["weight"] }
end