Class: Minato::Utils::BaseCommand::ShowBy

Inherits:
Object
  • Object
show all
Includes:
SimpleCommand
Defined in:
lib/minato/utils/base_command/show_by.rb

Instance Method Summary collapse

Constructor Details

#initialize(model_class, attribute, value) ⇒ ShowBy

Returns a new instance of ShowBy.



9
10
11
12
13
# File 'lib/minato/utils/base_command/show_by.rb', line 9

def initialize(model_class, attribute, value)
  @model_class = model_class
  @attribute = attribute
  @value = value
end

Instance Method Details

#callObject



15
16
17
# File 'lib/minato/utils/base_command/show_by.rb', line 15

def call
  @model_class.send :find_by!, @attribute => @value
end