Class: YAMLCommand::Command::SlurpCommand

Inherits:
YAMLCommand::Command show all
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

#file

Instance Method Summary collapse

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

Returns:

  • (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