Module: HSQL
- Defined in:
- lib/hsql.rb,
lib/hsql/file.rb,
lib/hsql/query.rb,
lib/hsql/version.rb,
lib/hsql/template.rb
Defined Under Namespace
Classes: File, FormatError, Query, Template
Constant Summary collapse
- VERSION =
'0.2.0'
Class Method Summary collapse
-
.parse(string, environment) ⇒ Object
Given the contents of a SQL file with YAML front matter (see README for an example) this will return a HSQL::File object providing access to the parts of that file.
- .parse_file(file, environment) ⇒ Object
Class Method Details
.parse(string, environment) ⇒ Object
Given the contents of a SQL file with YAML front matter (see README for an example) this will return a HSQL::File object providing access to the parts of that file.
15 16 17 18 |
# File 'lib/hsql.rb', line 15 def self.parse(string, environment) fail ArgumentError, 'The environment argument is required' unless environment File.new(string, environment).parse! end |
.parse_file(file, environment) ⇒ Object
20 21 22 |
# File 'lib/hsql.rb', line 20 def self.parse_file(file, environment) parse(file.read, environment) end |