Class: Kojo::Commands::ToJsonCmd
- Inherits:
-
CommandBase
- Object
- MisterBin::Command
- CommandBase
- Kojo::Commands::ToJsonCmd
- Defined in:
- lib/kojo/commands/to_json.rb
Overview
Handle calls to the kojo dir command
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#replace_files ⇒ Object
readonly
Returns the value of attribute replace_files.
-
#save_files ⇒ Object
readonly
Returns the value of attribute save_files.
Instance Method Summary collapse
Methods inherited from CommandBase
Instance Attribute Details
#input ⇒ Object (readonly)
Returns the value of attribute input.
9 10 11 |
# File 'lib/kojo/commands/to_json.rb', line 9 def input @input end |
#replace_files ⇒ Object (readonly)
Returns the value of attribute replace_files.
9 10 11 |
# File 'lib/kojo/commands/to_json.rb', line 9 def replace_files @replace_files end |
#save_files ⇒ Object (readonly)
Returns the value of attribute save_files.
9 10 11 |
# File 'lib/kojo/commands/to_json.rb', line 9 def save_files @save_files end |
Instance Method Details
#run ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/kojo/commands/to_json.rb', line 27 def run @input = input_files @save_files = args['--save'] || args['--replace'] @replace_files = args['--replace'] save_files ? write : show end |