Class: Colloquy::Prompt
- Inherits:
-
Object
- Object
- Colloquy::Prompt
- Includes:
- Paginator
- Defined in:
- lib/colloquy/prompt.rb
Instance Attribute Summary collapse
-
#flow ⇒ Object
Returns the value of attribute flow.
Instance Method Summary collapse
- #==(string) ⇒ Object
- #freeze ⇒ Object
-
#initialize(options = {}) ⇒ Prompt
constructor
A new instance of Prompt.
- #key(input) ⇒ Object
- #render(page = @page) ⇒ Object
Methods included from Paginator
Constructor Details
#initialize(options = {}) ⇒ Prompt
Returns a new instance of Prompt.
7 8 9 10 11 |
# File 'lib/colloquy/prompt.rb', line 7 def initialize( = {}) @message = [:message] || '' @page = [:page] || 1 @flow = [:flow] || nil end |
Instance Attribute Details
#flow ⇒ Object
Returns the value of attribute flow.
5 6 7 |
# File 'lib/colloquy/prompt.rb', line 5 def flow @flow end |
Instance Method Details
#==(string) ⇒ Object
20 21 22 |
# File 'lib/colloquy/prompt.rb', line 20 def ==(string) @message == string end |
#freeze ⇒ Object
24 25 26 |
# File 'lib/colloquy/prompt.rb', line 24 def freeze @message.freeze end |
#key(input) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/colloquy/prompt.rb', line 28 def key(input) if input.to_s == '1' :more else :unknown end end |
#render(page = @page) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/colloquy/prompt.rb', line 13 def render(page = @page) paginate unless @pages execute_before_page_hook "#{render_body(page)}" end |