Class: Controll::Notify::Message
- Inherits:
-
Object
- Object
- Controll::Notify::Message
- Defined in:
- lib/controll/notify/message.rb,
lib/controll/notify/message/handler.rb,
lib/controll/notify/message/resolver.rb,
lib/controll/notify/message/translator.rb
Defined Under Namespace
Classes: Handler, Resolver, Translator
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text, options = {}) ⇒ Message
constructor
A new instance of Message.
- #translate? ⇒ Boolean
Constructor Details
#initialize(text, options = {}) ⇒ Message
Returns a new instance of Message.
9 10 11 12 13 |
# File 'lib/controll/notify/message.rb', line 9 def initialize text, = {} raise ArgumentError, "Message text must be a String or Symbol" unless valid_text? text @text = text @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/controll/notify/message.rb', line 7 def @options end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
7 8 9 |
# File 'lib/controll/notify/message.rb', line 7 def text @text end |
Instance Method Details
#translate? ⇒ Boolean
15 16 17 |
# File 'lib/controll/notify/message.rb', line 15 def translate? text.kind_of? Symbol end |