Class: Ruff::Effect
- Inherits:
-
Object
- Object
- Ruff::Effect
- Defined in:
- lib/ruff/effect.rb
Overview
This class provides an effect instance.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Each instance must be unique so they have unique id with an annonymous class instance.
Class Method Summary collapse
-
.<<(parent) ⇒ Effect<Arg, Ret>
instanciates an effect, which has an relation
self <: parent
from the subtyping ofid
object.
Instance Method Summary collapse
-
#initialize ⇒ Effect<Arg, Ret>
constructor
instaciates an effect setting
id
. -
#perform(*a) ⇒ Ret
sends an effect ID and its arguments to a nearmost handler.
Constructor Details
#initialize ⇒ Effect<Arg, Ret>
instaciates an effect setting id
.
15 16 17 |
# File 'lib/ruff/effect.rb', line 15 def initialize @id = Class.new.new end |
Instance Attribute Details
#id ⇒ Object (readonly)
Each instance must be unique so they have unique id with an annonymous class instance.
The class instance may have subtyping relation.
9 10 11 |
# File 'lib/ruff/effect.rb', line 9 def id @id end |
Class Method Details
.<<(parent) ⇒ Effect<Arg, Ret>
instanciates an effect, which has an relation self <: parent
from the subtyping of id
object.
37 38 39 40 41 42 |
# File 'lib/ruff/effect.rb', line 37 def self.<<(parent) inst = new parent_id = parent.instance_variable_get('@id') inst.instance_variable_set('@id', (Class.new parent_id.class).new) inst end |