Class: Rule
- Inherits:
-
Object
- Object
- Rule
- Defined in:
- lib/gamefic/rule.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#caller ⇒ Object
readonly
Returns the value of attribute caller.
Instance Method Summary collapse
-
#initialize(name, &block) ⇒ Rule
constructor
A new instance of Rule.
- #test(actor, verb, arguments) ⇒ Object
Constructor Details
#initialize(name, &block) ⇒ Rule
Returns a new instance of Rule.
3 4 5 6 |
# File 'lib/gamefic/rule.rb', line 3 def initialize name, &block @name = name @block = block end |
Instance Attribute Details
#caller ⇒ Object (readonly)
Returns the value of attribute caller.
2 3 4 |
# File 'lib/gamefic/rule.rb', line 2 def caller @caller end |
Instance Method Details
#test(actor, verb, arguments) ⇒ Object
7 8 9 |
# File 'lib/gamefic/rule.rb', line 7 def test actor, verb, arguments return @block.call actor, verb, arguments end |