Class: Clin::ShellInteraction
- Inherits:
-
Object
- Object
- Clin::ShellInteraction
- Defined in:
- lib/clin/shell_interaction.rb
Overview
Parent class for shell interaction.
Direct Known Subclasses
Defined Under Namespace
Classes: Choose, FileConflict, Select, YesOrNo
Class Attribute Summary collapse
-
.persist ⇒ Object
Returns the value of attribute persist.
Instance Attribute Summary collapse
-
#shell ⇒ Object
Returns the value of attribute shell.
Instance Method Summary collapse
-
#initialize(shell) ⇒ ShellInteraction
constructor
A new instance of ShellInteraction.
-
#persist! ⇒ Object
Mark the current shell to persist file interaction.
- #persist? ⇒ Boolean
- #persist_answer ⇒ Object
Constructor Details
#initialize(shell) ⇒ ShellInteraction
Returns a new instance of ShellInteraction.
12 13 14 15 |
# File 'lib/clin/shell_interaction.rb', line 12 def initialize(shell) @shell = shell self.class.persist ||= {} end |
Class Attribute Details
.persist ⇒ Object
Returns the value of attribute persist.
6 7 8 |
# File 'lib/clin/shell_interaction.rb', line 6 def persist @persist end |
Instance Attribute Details
#shell ⇒ Object
Returns the value of attribute shell.
9 10 11 |
# File 'lib/clin/shell_interaction.rb', line 9 def shell @shell end |
Instance Method Details
#persist! ⇒ Object
Mark the current shell to persist file interaction
23 24 25 |
# File 'lib/clin/shell_interaction.rb', line 23 def persist! self.class.persist[@shell] = persist_answer end |
#persist? ⇒ Boolean
18 19 20 |
# File 'lib/clin/shell_interaction.rb', line 18 def persist? self.class.persist[@shell] ||= false end |
#persist_answer ⇒ Object
27 28 29 |
# File 'lib/clin/shell_interaction.rb', line 27 def persist_answer true end |