Module: Dcc::Schema
- Defined in:
- lib/dcc/schema.rb,
lib/dcc/schema/version.rb
Defined Under Namespace
Modules: Version
Constant Summary collapse
- RESOURCES_DIR =
File.("schema/resources", __dir__).freeze
Class Method Summary collapse
-
.exists?(relative_path) ⇒ Boolean
Whether the bundled resource exists.
-
.path(relative_path) ⇒ String
Absolute filesystem path.
-
.read(relative_path) ⇒ String
Read a bundled resource's contents.
Class Method Details
.exists?(relative_path) ⇒ Boolean
Returns whether the bundled resource exists.
24 25 26 |
# File 'lib/dcc/schema.rb', line 24 def exists?(relative_path) File.file?(path(relative_path)) end |
.path(relative_path) ⇒ String
Returns absolute filesystem path.
19 20 21 |
# File 'lib/dcc/schema.rb', line 19 def path(relative_path) File.join(RESOURCES_DIR, *Array(relative_path)) end |
.read(relative_path) ⇒ String
Read a bundled resource's contents.
30 31 32 |
# File 'lib/dcc/schema.rb', line 30 def read(relative_path) File.read(path(relative_path)) end |