Class: Matrixeval::Context::FindByCommandOptions
- Inherits:
-
Object
- Object
- Matrixeval::Context::FindByCommandOptions
- Defined in:
- lib/matrixeval/context/find_by_command_options.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options) ⇒ FindByCommandOptions
constructor
A new instance of FindByCommandOptions.
Constructor Details
#initialize(options) ⇒ FindByCommandOptions
Returns a new instance of FindByCommandOptions.
12 13 14 |
# File 'lib/matrixeval/context/find_by_command_options.rb', line 12 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/matrixeval/context/find_by_command_options.rb', line 10 def @options end |
Class Method Details
.call(options) ⇒ Object
5 6 7 |
# File 'lib/matrixeval/context/find_by_command_options.rb', line 5 def call() new().call end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/matrixeval/context/find_by_command_options.rb', line 16 def call context = Context.all.find do |context| context.main_variant == main_variant && context.rest_variants == rest_variants end raise Error.new("Can't find a corresponding matrix") if context.nil? context end |