Class: Vermillion::Helper::Results

Inherits:
Object
  • Object
show all
Defined in:
lib/client/helper/results.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResults

Create the Results object



8
9
10
11
# File 'lib/client/helper/results.rb', line 8

def initialize
  @bucket = []
  @bucket
end

Instance Attribute Details

#bucketObject (readonly)

Internal array to hold all the result values



5
6
7
# File 'lib/client/helper/results.rb', line 5

def bucket
  @bucket
end

Instance Method Details

#add(result) ⇒ Object

Add a result for processing Params:

result

The value you want to store



16
17
18
19
# File 'lib/client/helper/results.rb', line 16

def add(result)
  @bucket.push(result)
  result
end

#should_eval_to(pass_value) ⇒ Object

Check if all values match a specified value Params:

pass_value

What all values in the array should evaluate to



24
25
26
# File 'lib/client/helper/results.rb', line 24

def should_eval_to(pass_value)
  @bucket.all? == pass_value
end