Class: RubyJard::Pager
- Inherits:
-
Object
- Object
- RubyJard::Pager
- Defined in:
- lib/ruby_jard/pager.rb
Overview
Override Pry’s pager system. Again, Pry doesn’t support customizing pager. So…
Defined Under Namespace
Classes: JardPageTracker, LessPager
Instance Method Summary collapse
-
#initialize(pry_instance) ⇒ Pager
constructor
A new instance of Pager.
- #open(options = {}) ⇒ Object
- #page(text) ⇒ Object
Constructor Details
#initialize(pry_instance) ⇒ Pager
Returns a new instance of Pager.
7 8 9 |
# File 'lib/ruby_jard/pager.rb', line 7 def initialize(pry_instance) @pry_instance = pry_instance end |
Instance Method Details
#open(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/ruby_jard/pager.rb', line 17 def open( = {}) pager = LessPager.new(@pry_instance, **) yield pager rescue Pry::Pager::StopPaging # Ignore ensure pager.close end |
#page(text) ⇒ Object
11 12 13 14 15 |
# File 'lib/ruby_jard/pager.rb', line 11 def page(text) open do |pager| pager << text end end |