class Configurations::Validators::ReservedMethods

Constants

RESERVED_METHODS

Reserved methods are not assignable. They define behaviour needed for the configuration object to work properly.

Public Instance Methods

validate!(method) click to toggle source

@param [Symbol] method the method to test for reservedness @raise [Configurations::ReservedMethodError] raises this error if

a property is a reserved method.
# File lib/configurations/validators/reserved_methods.rb, line 8
def validate!(method)
  ::Kernel.fail(
    ::Configurations::ReservedMethodError,
    "#{method} is a reserved method and can not be assigned"
  ) if reserved?(method)
end

Private Instance Methods

reserved?(method) click to toggle source

@param [Symbol] method the method to test for @return [TrueClass, FalseClass] whether the method is reserved

# File lib/configurations/validators/reserved_methods.rb, line 33
def reserved?(method)
  RESERVED_METHODS.include?(method)
end