Class: SchemaRD::SchemaParser
- Inherits:
-
Object
- Object
- SchemaRD::SchemaParser
- Defined in:
- lib/schemard/schema_parser.rb
Instance Method Summary collapse
-
#initialize(filename) ⇒ SchemaParser
constructor
A new instance of SchemaParser.
- #parse(with_comment: false) ⇒ Object
Constructor Details
#initialize(filename) ⇒ SchemaParser
Returns a new instance of SchemaParser.
81 82 83 |
# File 'lib/schemard/schema_parser.rb', line 81 def initialize(filename) @filename = filename end |
Instance Method Details
#parse(with_comment: false) ⇒ Object
84 85 86 87 88 89 90 |
# File 'lib/schemard/schema_parser.rb', line 84 def parse(with_comment: false) Schema.new.tap do |schema| File.open(@filename) do |file| MigrationContext::Loader.new(schema, with_comment: with_comment).instance_eval(file.read, @filename) end end end |