Class: Yap::Shell::Prompt
- Inherits:
-
Object
- Object
- Yap::Shell::Prompt
- Defined in:
- lib/yap/shell/prompt.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text:, &blk) ⇒ Prompt
constructor
A new instance of Prompt.
- #update ⇒ Object
Constructor Details
#initialize(text:, &blk) ⇒ Prompt
Returns a new instance of Prompt.
5 6 7 8 |
# File 'lib/yap/shell/prompt.rb', line 5 def initialize(text:, &blk) @text = text @blk = blk end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/yap/shell/prompt.rb', line 3 def text @text end |
Instance Method Details
#update ⇒ Object
14 15 16 17 18 19 |
# File 'lib/yap/shell/prompt.rb', line 14 def update if @blk @text = @blk.call end self end |