Class: ActiveValidation::Values::MethodName

Inherits:
Base
  • Object
show all
Defined in:
lib/active_validation/values/method_name.rb

Constant Summary

Constants inherited from Base

Base::BAD_VALUES

Instance Attribute Summary

Attributes inherited from Base

#value

Instance Method Summary collapse

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