Module: Parser

Defined in:
lib/parser.rb

Class Method Summary collapse

Class Method Details

.decode(string) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/parser.rb', line 6

def self.decode(string)
  if pieces = string.match(@regexp)
    {type: pieces[1], id: pieces[2], end_point: pieces[4], data: pieces[5]}
  else
    {type: '0'}
  end
end