Class: Wallaby::Parser

Inherits:
Parslet::Parser
  • Object
show all
Defined in:
lib/parsers/wallaby/parser.rb

Overview

A parser to parse colon query string and return a hash for transformer to consume

Instance Method Summary collapse

Instance Method Details

#parse(str) ⇒ Hash

Parse string into Abstract Syntax Tree for transformer to consume

Parameters:

  • str (String)

Returns:

  • (Hash)

    Abstract Syntax Tree



# File 'lib/parsers/wallaby/parser.rb', line 7

#stri(str) ⇒ Object

Case insensitive string match

Parameters:

  • str (String)


14
15
16
# File 'lib/parsers/wallaby/parser.rb', line 14

def stri(str)
  str.chars.map! { |c| match["#{c.upcase}#{c.downcase}"] }.reduce :>>
end