Class: Serega::Attribute::CheckOptMethod
- Inherits:
-
Object
- Object
- Serega::Attribute::CheckOptMethod
- Defined in:
- lib/serega/validations/attribute/check_opt_method.rb
Class Method Summary collapse
-
.call(opts) ⇒ void
Checks attribute :method option.
Class Method Details
.call(opts) ⇒ void
This method returns an undefined value.
Checks attribute :method option
15 16 17 18 19 20 21 22 |
# File 'lib/serega/validations/attribute/check_opt_method.rb', line 15 def self.call(opts) return unless opts.key?(:method) value = opts[:method] return if value.is_a?(String) || value.is_a?(Symbol) raise Error, "Invalid option :method => #{value.inspect}. Must be a String or a Symbol" end |