Class: Yaml::Exec::Cli
- Inherits:
-
Object
- Object
- Yaml::Exec::Cli
- Defined in:
- lib/yaml/exec.rb
Instance Method Summary collapse
-
#initialize ⇒ Cli
constructor
A new instance of Cli.
- #run ⇒ Object
Constructor Details
#initialize ⇒ Cli
Returns a new instance of Cli.
8 9 10 11 12 13 14 |
# File 'lib/yaml/exec.rb', line 8 def initialize *args, path = ARGV abort 'command is required for 1st arg' if args.empty? abort 'yml file is needed for 2nd arg' if path.nil? @cmd = args.join ' ' @yml = YAML.load_file path end |
Instance Method Details
#run ⇒ Object
16 17 18 |
# File 'lib/yaml/exec.rb', line 16 def run cmd_list @yml end |