Class: EM::Pusher::Client::MsgParser
- Inherits:
-
Object
- Object
- EM::Pusher::Client::MsgParser
- Defined in:
- lib/em/pusher/client/msg_parser.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#json ⇒ Object
readonly
Returns the value of attribute json.
Instance Method Summary collapse
- #event ⇒ Object
-
#initialize(msg) ⇒ MsgParser
constructor
A new instance of MsgParser.
- #to_s ⇒ Object
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
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/em/pusher/client/msg_parser.rb', line 7 def data @data end |
#json ⇒ Object (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
#event ⇒ Object
14 15 16 |
# File 'lib/em/pusher/client/msg_parser.rb', line 14 def event @event ||= json['event'] end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/em/pusher/client/msg_parser.rb', line 18 def to_s @msg.to_s end |