Class: Vermillion::Helper::Results
- Inherits:
-
Object
- Object
- Vermillion::Helper::Results
- Defined in:
- lib/client/helper/results.rb
Instance Attribute Summary collapse
-
#bucket ⇒ Object
readonly
Internal array to hold all the result values.
Instance Method Summary collapse
-
#add(result) ⇒ Object
- Add a result for processing Params:
result -
The value you want to store.
- Add a result for processing Params:
-
#initialize ⇒ Results
constructor
Create the Results object.
-
#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.
- Check if all values match a specified value Params:
Constructor Details
#initialize ⇒ Results
Create the Results object
8 9 10 11 |
# File 'lib/client/helper/results.rb', line 8 def initialize @bucket = [] @bucket end |
Instance Attribute Details
#bucket ⇒ Object (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 |