Class: SimpleService::ArgumentValidator
- Inherits:
-
Object
- Object
- SimpleService::ArgumentValidator
- Defined in:
- lib/simple_service/argument_validator.rb
Instance Attribute Summary collapse
-
#commands ⇒ Object
Returns the value of attribute commands.
-
#context ⇒ Object
Returns the value of attribute context.
-
#expects ⇒ Object
Returns the value of attribute expects.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(opts) ⇒ ArgumentValidator
constructor
A new instance of ArgumentValidator.
Constructor Details
#initialize(opts) ⇒ ArgumentValidator
6 7 8 9 10 |
# File 'lib/simple_service/argument_validator.rb', line 6 def initialize(opts) @context = opts[:context] @expects = opts[:expects] @commands = opts[:commands] end |
Instance Attribute Details
#commands ⇒ Object
Returns the value of attribute commands.
4 5 6 |
# File 'lib/simple_service/argument_validator.rb', line 4 def commands @commands end |
#context ⇒ Object
Returns the value of attribute context.
4 5 6 |
# File 'lib/simple_service/argument_validator.rb', line 4 def context @context end |
#expects ⇒ Object
Returns the value of attribute expects.
4 5 6 |
# File 'lib/simple_service/argument_validator.rb', line 4 def expects @expects end |
Instance Method Details
#execute ⇒ Object
12 13 14 15 16 17 |
# File 'lib/simple_service/argument_validator.rb', line 12 def execute validate_expected_arguments validate_commands_not_empty validate_commands_properly_inherit true end |