Class: Rain::Effect
- Inherits:
-
Object
- Object
- Rain::Effect
- Defined in:
- lib/matrix/effects/effect.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#last_output ⇒ Object
Returns the value of attribute last_output.
Instance Method Summary collapse
-
#initialize(config:) ⇒ Effect
constructor
A new instance of Effect.
- #save(output:, x:, y:) ⇒ Object
Constructor Details
#initialize(config:) ⇒ Effect
Returns a new instance of Effect.
7 8 9 10 |
# File 'lib/matrix/effects/effect.rb', line 7 def initialize(config:) @config = config @last_output = {} end |
Instance Attribute Details
#last_output ⇒ Object
Returns the value of attribute last_output.
5 6 7 |
# File 'lib/matrix/effects/effect.rb', line 5 def last_output @last_output end |
Instance Method Details
#save(output:, x:, y:) ⇒ Object
12 13 14 15 |
# File 'lib/matrix/effects/effect.rb', line 12 def save(output:, x:, y:) @last_output[x] ||= {} @last_output[x][y] = output end |