Class: Controll::Notify::Message

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(text, options = {}) ⇒ Message

Returns a new instance of Message.

Raises:

  • (ArgumentError)


9
10
11
12
13
# File 'lib/controll/notify/message.rb', line 9

def initialize text, options = {}
  raise ArgumentError, "Message text must be a String or Symbol" unless valid_text? text
  @text    = text
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/controll/notify/message.rb', line 7

def options
  @options
end

#textObject (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

Returns:

  • (Boolean)


15
16
17
# File 'lib/controll/notify/message.rb', line 15

def translate?
  text.kind_of? Symbol
end