Class: YAMLCommand::Command::SlurpCommand
- Inherits:
-
YAMLCommand::Command
- Object
- Executable::Command
- YAMLCommand::Command
- YAMLCommand::Command::SlurpCommand
- Defined in:
- lib/yaml_command/slurp.rb
Overview
Given a directory, read each file into a mapping with directories into a nested mapping.
Instance Attribute Summary
Attributes inherited from YAMLCommand::Command
Instance Method Summary collapse
- #recurse=(boolean) ⇒ Object
- #recurse? ⇒ Boolean
-
#slurp(dir) ⇒ Object
(also: #call)
Import each file of a directory into a YAML file.
Methods inherited from YAMLCommand::Command
command_name, #debug=, #debug?, #h!, #help!, #inspect=, #inspect?, #json=, #json?, #mute=, #mute?, #yaml=, #yaml?
Instance Method Details
#recurse=(boolean) ⇒ Object
22 23 24 |
# File 'lib/yaml_command/slurp.rb', line 22 def recurse=(boolean) @recurse = boolean end |
#recurse? ⇒ Boolean
17 18 19 |
# File 'lib/yaml_command/slurp.rb', line 17 def recurse? @recurse end |
#slurp(dir) ⇒ Object Also known as: call
Import each file of a directory into a YAML file.
9 10 11 |
# File 'lib/yaml_command/slurp.rb', line 9 def slurp(dir) output slurp_directory(dir) end |