Class: EM::Pusher::Client::MsgParser

Inherits:
Object
  • Object
show all
Defined in:
lib/em/pusher/client/msg_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg) ⇒ MsgParser

Returns a new instance of MsgParser.



10
11
12
# File 'lib/em/pusher/client/msg_parser.rb', line 10

def initialize(msg)
  parse(msg)
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



7
8
9
# File 'lib/em/pusher/client/msg_parser.rb', line 7

def data
  @data
end

#jsonObject (readonly)

Returns the value of attribute json.



7
8
9
# File 'lib/em/pusher/client/msg_parser.rb', line 7

def json
  @json
end

Instance Method Details

#eventObject



14
15
16
# File 'lib/em/pusher/client/msg_parser.rb', line 14

def event
  @event ||= json['event']
end

#to_sObject



18
19
20
# File 'lib/em/pusher/client/msg_parser.rb', line 18

def to_s
  @msg.to_s
end