Class: Cure::Dsl::Validator
- Inherits:
-
Object
- Object
- Cure::Dsl::Validator
- Defined in:
- lib/cure/dsl/validator.rb
Instance Attribute Summary collapse
-
#candidates ⇒ Object
readonly
Returns the value of attribute candidates.
Instance Method Summary collapse
- #candidate(column: nil, named_range: "_default", options: {}, &block) ⇒ Object
-
#initialize ⇒ Validator
constructor
A new instance of Validator.
Constructor Details
#initialize ⇒ Validator
Returns a new instance of Validator.
11 12 13 |
# File 'lib/cure/dsl/validator.rb', line 11 def initialize @candidates = [] end |
Instance Attribute Details
#candidates ⇒ Object (readonly)
Returns the value of attribute candidates.
9 10 11 |
# File 'lib/cure/dsl/validator.rb', line 9 def candidates @candidates end |
Instance Method Details
#candidate(column: nil, named_range: "_default", options: {}, &block) ⇒ Object
15 16 17 18 19 |
# File 'lib/cure/dsl/validator.rb', line 15 def candidate(column: nil, named_range: "_default", options: {}, &block) candidate = Cure::Validator::Candidate.new(column, named_range, ) @candidates << candidate candidate.instance_exec(&block) end |