Class: Riot::Helper

Inherits:
RunnableBlock show all
Defined in:
lib/riot/runnable.rb

Overview

Setup

Instance Attribute Summary

Attributes inherited from RunnableBlock

#definition

Instance Method Summary collapse

Methods inherited from RunnableBlock

#to_s

Constructor Details

#initialize(name, &definition) ⇒ Helper

Returns a new instance of Helper.



23
24
25
26
# File 'lib/riot/runnable.rb', line 23

def initialize(name, &definition)
  super("helper #{name}", &definition)
  @name = name
end

Instance Method Details

#run(situation) ⇒ Object



28
29
30
31
# File 'lib/riot/runnable.rb', line 28

def run(situation)
  situation.helper(@name, &definition)
  [:helper]
end