Class: Cure::Dsl::Validator

Inherits:
Object
  • Object
show all
Defined in:
lib/cure/dsl/validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeValidator

Returns a new instance of Validator.



11
12
13
# File 'lib/cure/dsl/validator.rb', line 11

def initialize
  @candidates = []
end

Instance Attribute Details

#candidatesObject (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, options)
  @candidates << candidate
  candidate.instance_exec(&block)
end