Class: Minato::Utils::BaseCommand::Index
- Inherits:
-
Object
- Object
- Minato::Utils::BaseCommand::Index
- Includes:
- SimpleCommand
- Defined in:
- lib/minato/utils/base_command/index.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(model_class, filters = {}) ⇒ Index
constructor
A new instance of Index.
Constructor Details
#initialize(model_class, filters = {}) ⇒ Index
Returns a new instance of Index.
9 10 11 12 |
# File 'lib/minato/utils/base_command/index.rb', line 9 def initialize(model_class, filters = {}) @model_class = model_class @filters = filters end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 |
# File 'lib/minato/utils/base_command/index.rb', line 14 def call return @model_class.where(@filters) if @filters.present? @model_class.all end |