Class: Gloss::Parser
- Inherits:
-
Object
- Object
- Gloss::Parser
- Defined in:
- lib/gloss/parser.rb
Instance Method Summary collapse
-
#initialize(str) ⇒ Parser
constructor
A new instance of Parser.
- #run ⇒ Object
Constructor Details
#initialize(str) ⇒ Parser
Returns a new instance of Parser.
8 9 10 |
# File 'lib/gloss/parser.rb', line 8 def initialize(str) @str = str end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/gloss/parser.rb', line 11 def run() tree_json = Gloss.parse_buffer(@str) begin JSON.parse(tree_json, symbolize_names: true) rescue JSON::ParserError raise(Errors::ParserError, tree_json) end end |