Class: Cure::Dsl::Builder

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBuilder

Returns a new instance of Builder.



12
13
14
# File 'lib/cure/dsl/builder.rb', line 12

def initialize
  @candidates = []
end

Instance Attribute Details

#candidatesObject (readonly)

Returns the value of attribute candidates.



10
11
12
# File 'lib/cure/dsl/builder.rb', line 10

def candidates
  @candidates
end

Instance Method Details

#candidate(column: nil, named_range: "_default", &block) ⇒ Object

Parameters:

  • column (String, nil) (defaults to: nil)
  • named_range (String) (defaults to: "_default")
  • block (Proc)


19
20
21
22
23
# File 'lib/cure/dsl/builder.rb', line 19

def candidate(column: nil, named_range: "_default", &block)
  candidate = Cure::Builder::Candidate.new(column, named_range)
  @candidates << candidate
  candidate.instance_exec(&block)
end