Module: Pavlov::Operation
- Extended by:
- ActiveSupport::Concern
- Includes:
- Helpers, Validations, Virtus
- Included in:
- Command, Interactor, Command, Interactor, Query, Query
- Defined in:
- lib/pavlov/operation.rb,
lib/pavlov/alpha_compatibility.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
Methods included from Helpers
#command, #interactor, #old_command, #old_interactor, #old_query, #pavlov_options, #query
Instance Method Details
#call(*args, &block) ⇒ Object
23 24 25 26 27 |
# File 'lib/pavlov/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/pavlov/operation.rb', line 14 def validate return false unless attributes_without_defaults_have_values if respond_to? :valid? raise Pavlov::ValidationError, "an argument is invalid" unless valid? else true end end |