Class: RubyQC::Modifier
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#cases ⇒ Object
Returns the value of attribute cases.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#threads ⇒ Object
Returns the value of attribute threads.
Instance Method Summary collapse
-
#initialize(args, &block) ⇒ Modifier
constructor
A new instance of Modifier.
- #parallel(t, &block) ⇒ Object
- #times(t, &block) ⇒ Object
Methods inherited from Struct
Constructor Details
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args
5 6 7 |
# File 'lib/rubyqc/modifier.rb', line 5 def args @args end |
#cases ⇒ Object
Returns the value of attribute cases
5 6 7 |
# File 'lib/rubyqc/modifier.rb', line 5 def cases @cases end |
#errors ⇒ Object
Returns the value of attribute errors
5 6 7 |
# File 'lib/rubyqc/modifier.rb', line 5 def errors @errors end |
#threads ⇒ Object
Returns the value of attribute threads
5 6 7 |
# File 'lib/rubyqc/modifier.rb', line 5 def threads @threads end |
Instance Method Details
#parallel(t, &block) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/rubyqc/modifier.rb', line 18 def parallel t, &block raise ArgumentError.new( "Must have at least 1 thread, but got: #{t}") if t <= 0 self.threads = t run(&block) end |
#times(t, &block) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/rubyqc/modifier.rb', line 11 def times t, &block raise ArgumentError.new( "Must run at least once, but got: #{t}") if t <= 0 self.cases = t run(&block) end |