Module: Yamlr
- Defined in:
- lib/yamlr.rb,
lib/yamlr/errors.rb,
lib/yamlr/reader.rb,
lib/yamlr/writer.rb,
lib/yamlr/version.rb,
lib/yamlr/defaults.rb,
lib/yamlr/indicators.rb,
lib/yamlr/reader/node.rb,
lib/yamlr/reader/format.rb,
lib/yamlr/reader/parser.rb,
lib/yamlr/reader/builder.rb,
lib/yamlr/writer/builder.rb
Defined Under Namespace
Modules: Defaults, Errors, Indicators, Reader, Writer
Constant Summary collapse
- DOTFILE =
"#{ENV['HOME']}/.yamlr"- VERSION =
'2.0.0'
Class Method Summary collapse
-
.dotfile(home = ENV['HOME']) ⇒ Object
writes a .yamlr file HOME, merges with options if :dot is true.
-
.parse(object, options = {}) ⇒ Object
Hash or Array to .yml Array.
-
.read(input, options = {}) ⇒ Object
File to Hash or Array.
-
.write(object, filename, options = {}) ⇒ Object
Hash or Array to .yml file, e.g.
Class Method Details
.dotfile(home = ENV['HOME']) ⇒ Object
writes a .yamlr file HOME, merges with options if :dot is true
30 31 32 |
# File 'lib/yamlr.rb', line 30 def self.dotfile(home = ENV['HOME']) Yamlr::Writer.dotfile(Yamlr::Defaults., home) end |
.parse(object, options = {}) ⇒ Object
Hash or Array to .yml Array
18 19 20 |
# File 'lib/yamlr.rb', line 18 def self.parse(object, = {}) Yamlr::Writer.build(object, self.()) end |
.read(input, options = {}) ⇒ Object
File to Hash or Array
12 13 14 |
# File 'lib/yamlr.rb', line 12 def self.read(input, = {}) Yamlr::Reader.read(input, self.()) end |
.write(object, filename, options = {}) ⇒ Object
Hash or Array to .yml file, e.g. filename.yml
24 25 26 |
# File 'lib/yamlr.rb', line 24 def self.write(object, filename, = {}) Yamlr::Writer.write(object, filename, self.()) end |