Class: ActiveValidation::Values::MethodName
- Defined in:
- lib/active_validation/values/method_name.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(value) ⇒ MethodName
constructor
A new instance of MethodName.
Methods inherited from Base
#<=>, #==, #as_json, #to_s, #to_sym
Constructor Details
#initialize(value) ⇒ MethodName
7 8 9 10 11 12 13 |
# File 'lib/active_validation/values/method_name.rb', line 7 def initialize(value) unless allowed_methods.include? value.to_s raise ActiveValidation::Errors::UnsupportedMethodError.new value: value, allowed_methods: allowed_methods end super value.to_s end |