summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbinoam Praxedes Marques Jr <abinoam@gmail.com>2015-12-14 11:55:10 -0300
committerAbinoam Praxedes Marques Jr <abinoam@gmail.com>2015-12-14 11:55:10 -0300
commita4104974be7961b95ea1709781f87b24e191abab (patch)
tree46f1b5b23d72283a65d49974cc877c3a00d1fa0d
parent2339259773cd04104967d883dfa07fbf9d646d18 (diff)
downloadhighline-a4104974be7961b95ea1709781f87b24e191abab.tar.gz
Improve HighLine::Paginator documentation
-rw-r--r--lib/highline/paginator.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/highline/paginator.rb b/lib/highline/paginator.rb
index 62a73a5..48792af 100644
--- a/lib/highline/paginator.rb
+++ b/lib/highline/paginator.rb
@@ -1,9 +1,17 @@
# coding: utf-8
class HighLine
+ # Take the task of paginating some piece of text given a HighLine context
class Paginator
+
+ # @return [HighLine] HighLine context
attr_reader :highline
+ # Returns a HighLine::Paginator instance where you can
+ # call {#page_print} on it.
+ # @param highline [HighLine] context
+ # @example
+ # HighLine::Paginator.new(highline).page_print(statement)
def initialize(highline)
@highline = highline
end
@@ -16,6 +24,8 @@ class HighLine
# Note that the final page of _output_ is *not* printed, but returned
# instead. This is to support any special handling for the final sequence.
#
+ # @param text [String] text to be paginated
+ # @return [String] last line if paging is aborted
def page_print(text)
return text unless highline.page_at