Class: Semaph::Shells::Project::SaveCommand
- Inherits:
-
Object
- Object
- Semaph::Shells::Project::SaveCommand
- Defined in:
- lib/semaph/shells/project/save_command.rb
Instance Attribute Summary collapse
-
#help ⇒ Object
readonly
Returns the value of attribute help.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #execute(_ignored) ⇒ Object
-
#initialize(project) ⇒ SaveCommand
constructor
A new instance of SaveCommand.
Constructor Details
#initialize(project) ⇒ SaveCommand
Returns a new instance of SaveCommand.
9 10 11 12 |
# File 'lib/semaph/shells/project/save_command.rb', line 9 def initialize(project) @project = project @help = "save current project as default for this folder" end |
Instance Attribute Details
#help ⇒ Object (readonly)
Returns the value of attribute help.
7 8 9 |
# File 'lib/semaph/shells/project/save_command.rb', line 7 def help @help end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
7 8 9 |
# File 'lib/semaph/shells/project/save_command.rb', line 7 def project @project end |
Instance Method Details
#execute(_ignored) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/semaph/shells/project/save_command.rb', line 14 def execute(_ignored) config = { host: project.client.host, project: project.raw, } File.open(".semaph", "w") do |file| file.puts config.to_yaml end end |