Class: Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/gamefic/rule.rb

Direct Known Subclasses

Assert

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#callerObject (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