Class: Lotion::Command
- Inherits:
-
Object
- Object
- Lotion::Command
- Includes:
- Notifications
- Defined in:
- lib/lotion/command.rb
Instance Attribute Summary collapse
-
#notification ⇒ Object
readonly
Returns the value of attribute notification.
Class Method Summary collapse
Instance Method Summary collapse
-
#call ⇒ Object
TODO this could be a macro on Module.
-
#initialize(notification) ⇒ Command
constructor
A new instance of Command.
-
#name ⇒ Object
TODO delegate.
-
#object ⇒ Object
TODO delegate.
-
#userInfo ⇒ Object
TODO delegate.
Methods included from Notifications
Constructor Details
#initialize(notification) ⇒ Command
Returns a new instance of Command.
9 10 11 |
# File 'lib/lotion/command.rb', line 9 def initialize( notification ) @notification = notification end |
Instance Attribute Details
#notification ⇒ Object (readonly)
Returns the value of attribute notification.
12 13 14 |
# File 'lib/lotion/command.rb', line 12 def notification @notification end |
Class Method Details
.call(notification) ⇒ Object
23 24 25 |
# File 'lib/lotion/command.rb', line 23 def self.call( notification ) new( notification ).call end |
Instance Method Details
#call ⇒ Object
TODO this could be a macro on Module
17 18 19 |
# File 'lib/lotion/command.rb', line 17 def call raise NotImplementedError, 'Lotion::Command subclasses are expected to define #call' end |
#name ⇒ Object
TODO delegate
29 30 31 |
# File 'lib/lotion/command.rb', line 29 def name notification.name end |
#object ⇒ Object
TODO delegate
35 36 37 |
# File 'lib/lotion/command.rb', line 35 def object notification.object end |
#userInfo ⇒ Object
TODO delegate
41 42 43 |
# File 'lib/lotion/command.rb', line 41 def userInfo notification.userInfo end |