Class: RubyQC::Modifier

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyqc/modifier.rb

Instance Method Summary collapse

Constructor Details

#initialize(args, &block) ⇒ Modifier

Returns a new instance of Modifier.



4
5
6
7
8
# File 'lib/rubyqc/modifier.rb', line 4

def initialize args, &block
  @args  = args
  @times = 10
  run(&block)
end

Instance Method Details

#runObject



15
16
17
18
19
# File 'lib/rubyqc/modifier.rb', line 15

def run
  @times.times{
    yield(*@args.map(&:rubyqc))
  } if block_given?
end

#times(t, &block) ⇒ Object



10
11
12
13
# File 'lib/rubyqc/modifier.rb', line 10

def times t, &block
  @times = t
  run(&block)
end