Class | TTK::Strategies::Block |
In: |
lib/ttk/strategies/Block.rb
|
Parent: | Strategy |
# File lib/ttk/strategies/Block.rb, line 14 def self.create ( *a, &block ) raise ArgumentError, 'need a block' unless block_given? strategy = new(*a) strategy.test = block strategy end
# File lib/ttk/strategies/Block.rb, line 21 def test=(block1=nil, &block2) if block_given? @test = block2 elsif !block1.nil? @test = block1 else raise ArgumentError, 'no block given' end if @test.is_a?(String) str = @test.dup @test = proc do eval str end end end