Class: Twiglet::Message

Inherits:
Hash
  • Object
show all
Defined in:
lib/twiglet/message.rb

Instance Method Summary collapse

Constructor Details

#initialize(msg) ⇒ Message

Returns a new instance of Message.



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/twiglet/message.rb', line 3

def initialize(msg)
  super
  case msg
  when String
    self[:message] = msg
  when Hash
    replace(msg.transform_keys!(&:to_sym))
  else
    super
  end
end