Module: Gollum::Pagination
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#log_pagination_options(options = {}) ⇒ Object
Fills in git-specific options for the log command using simple pagination options.
-
#page_to_skip(page) ⇒ Object
Turns a page number into an offset number for the git skip option.
Class Method Details
.included(klass) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/gollum-lib/pagination.rb', line 4 def self.included(klass) klass.extend ClassMethods class << klass # Default Integer max count of items to return in git commands. attr_accessor :per_page end klass.per_page = 30 end |
Instance Method Details
#log_pagination_options(options = {}) ⇒ Object
Fills in git-specific options for the log command using simple pagination options.
options - Hash of options:
page - Optional Integer page number (default: 1)
per_page - Optional Integer max count of items to return.
Defaults to #per_class class method.
Returns Hash with :max_count and :skip keys.
58 59 60 |
# File 'lib/gollum-lib/pagination.rb', line 58 def ( = {}) self.class.() end |
#page_to_skip(page) ⇒ Object
Turns a page number into an offset number for the git skip option.
page - Integer page number.
Returns an Integer.
45 46 47 |
# File 'lib/gollum-lib/pagination.rb', line 45 def page_to_skip(page) self.class.page_to_skip(page) end |