Module: Servies::Operation
- Includes:
- ActiveSupport::Concern, Validations, Virtus
- Included in:
- Command, Interactor, Query
- Defined in:
- lib/servies/operation.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Methods included from Validations
#validate_hexadecimal_string, #validate_in_set, #validate_integer, #validate_integer_string, #validate_nonempty_string, #validate_not_nil, #validate_regex, #validate_string
Instance Method Details
#call(*args, &block) ⇒ Object
23 24 25 26 27 |
# File 'lib/servies/operation.rb', line 23 def call(*args, &block) validate execute(*args, &block) end |
#validate ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/servies/operation.rb', line 14 def validate return false unless attributes_without_defaults_have_values if respond_to? :valid? raise Servies::ValidationError, "an argument is invalid" unless valid? else true end end |