Class: VanillaValidator::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/vanilla_validator/rule.rb

Overview

Rule represents a validation rule with a name and optional parameters.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, parameters) ⇒ Rule

Returns a new instance of Rule.



6
7
8
# File 'lib/vanilla_validator/rule.rb', line 6

def initialize(name, parameters)
  @name, @parameters = name, parameters
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/vanilla_validator/rule.rb', line 4

def name
  @name
end

#parametersObject

Returns the value of attribute parameters.



4
5
6
# File 'lib/vanilla_validator/rule.rb', line 4

def parameters
  @parameters
end