Class: Calyx::Format::JSONGrammar
- Inherits:
-
Object
- Object
- Calyx::Format::JSONGrammar
- Defined in:
- lib/calyx/format.rb
Instance Method Summary collapse
- #each_rule(&block) ⇒ Object
-
#initialize(filename) ⇒ JSONGrammar
constructor
A new instance of JSONGrammar.
Constructor Details
#initialize(filename) ⇒ JSONGrammar
Returns a new instance of JSONGrammar.
32 33 34 35 36 37 |
# File 'lib/calyx/format.rb', line 32 def initialize(filename) require 'json' @filename = filename @contents = File.read(@filename) @rules = JSON.parse(@contents) end |