Class: Hairballs::Prompt
- Inherits:
-
Object
- Object
- Hairballs::Prompt
- Defined in:
- lib/hairballs/prompt.rb
Overview
Hairballs representation of IRB.conf. Method names here make prompt types clearer.
TODO: Make it nicer to define Pry prompts.
Instance Attribute Summary collapse
-
#irb_prompt_options ⇒ Object
readonly
Returns the value of attribute irb_prompt_options.
Instance Method Summary collapse
- #continued_statement ⇒ String
-
#continued_statement=(new_continued_statement) ⇒ Object
Wrapper for setting IRB.conf[:MY_PROMPT].
- #continued_string ⇒ String
-
#continued_string=(new_continued_string) ⇒ Object
Wrapper for setting IRB.conf[:MY_PROMPT].
- #indented_code ⇒ String
-
#indented_code=(new_indented_code) ⇒ Object
Wrapper for setting IRB.conf[:MY_PROMPT].
-
#initialize ⇒ Prompt
constructor
A new instance of Prompt.
- #normal ⇒ String
-
#normal=(new_normal) ⇒ Object
Wrapper for setting IRB.conf[:MY_PROMPT].
- #return_format ⇒ String
-
#return_format=(new_return_format) ⇒ Object
Wrapper for setting IRB.conf[:MY_PROMPT].
Constructor Details
#initialize ⇒ Prompt
Returns a new instance of Prompt.
15 16 17 18 |
# File 'lib/hairballs/prompt.rb', line 15 def initialize vputs 'Setting up prompt...' = IRB.conf[:PROMPT][:NULL].dup end |
Instance Attribute Details
#irb_prompt_options ⇒ Object (readonly)
Returns the value of attribute irb_prompt_options.
13 14 15 |
# File 'lib/hairballs/prompt.rb', line 13 def end |
Instance Method Details
#continued_statement ⇒ String
29 30 31 |
# File 'lib/hairballs/prompt.rb', line 29 def continued_statement [:PROMPT_C] end |
#continued_statement=(new_continued_statement) ⇒ Object
Wrapper for setting IRB.conf[:MY_PROMPT]. The prompt for when statements wrap multiple lines.
24 25 26 |
# File 'lib/hairballs/prompt.rb', line 24 def continued_statement=(new_continued_statement) [:PROMPT_C] = new_continued_statement end |
#continued_string ⇒ String
42 43 44 |
# File 'lib/hairballs/prompt.rb', line 42 def continued_string [:PROMPT_S] end |
#continued_string=(new_continued_string) ⇒ Object
Wrapper for setting IRB.conf[:MY_PROMPT]. The prompt for when strings wrap multiple lines.
37 38 39 |
# File 'lib/hairballs/prompt.rb', line 37 def continued_string=(new_continued_string) [:PROMPT_S] = new_continued_string end |
#indented_code ⇒ String
55 56 57 |
# File 'lib/hairballs/prompt.rb', line 55 def indented_code [:PROMPT_N] end |
#indented_code=(new_indented_code) ⇒ Object
Wrapper for setting IRB.conf[:MY_PROMPT]. The prompt for when statements include indentation.
50 51 52 |
# File 'lib/hairballs/prompt.rb', line 50 def indented_code=(new_indented_code) [:PROMPT_N] = new_indented_code end |
#normal ⇒ String
67 68 69 |
# File 'lib/hairballs/prompt.rb', line 67 def normal [:PROMPT_I] end |
#normal=(new_normal) ⇒ Object
Wrapper for setting IRB.conf[:MY_PROMPT].
62 63 64 |
# File 'lib/hairballs/prompt.rb', line 62 def normal=(new_normal) [:PROMPT_I] = new_normal end |
#return_format ⇒ String
80 81 82 |
# File 'lib/hairballs/prompt.rb', line 80 def return_format [:RETURN] end |
#return_format=(new_return_format) ⇒ Object
Wrapper for setting IRB.conf[:MY_PROMPT]. The prompt for how to display return values.
75 76 77 |
# File 'lib/hairballs/prompt.rb', line 75 def return_format=(new_return_format) [:RETURN] = new_return_format end |