Class: Ellen::Message
- Inherits:
-
Object
- Object
- Ellen::Message
- Defined in:
- lib/ellen/message.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(options) ⇒ Message
constructor
A new instance of Message.
- #match(pattern, options = {}) ⇒ Object
Constructor Details
#initialize(options) ⇒ Message
Returns a new instance of Message.
5 6 7 8 9 |
# File 'lib/ellen/message.rb', line 5 def initialize() @body = [:body] @source = [:source] @command = [:command] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/ellen/message.rb', line 3 def body @body end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
3 4 5 |
# File 'lib/ellen/message.rb', line 3 def command @command end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
3 4 5 |
# File 'lib/ellen/message.rb', line 3 def source @source end |
Instance Method Details
#match(pattern, options = {}) ⇒ Object
11 12 13 |
# File 'lib/ellen/message.rb', line 11 def match(pattern, = {}) (![:command] || command) && pattern === body end |