Class: RailsInteractive::CLI::Category
- Inherits:
-
Object
- Object
- RailsInteractive::CLI::Category
- Defined in:
- lib/cli/category.rb
Overview
Categories class for the interactive CLI module
Instance Method Summary collapse
- #all ⇒ Object
-
#initialize ⇒ Category
constructor
A new instance of Category.
Constructor Details
#initialize ⇒ Category
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
#all ⇒ Object
13 14 15 |
# File 'lib/cli/category.rb', line 13 def all @categories.sort_by { |category| category["weight"] } end |