Class: Gollum::Sorters::WikiSorter
- Inherits:
-
Object
- Object
- Gollum::Sorters::WikiSorter
- Defined in:
- lib/gollum-lib/sorters/wiki_sorter.rb
Constant Summary collapse
- SORT_CREATED_AT =
"created_at".freeze
Instance Attribute Summary collapse
-
#direction_desc ⇒ Object
readonly
Returns the value of attribute direction_desc.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#sort ⇒ Object
readonly
Returns the value of attribute sort.
Instance Method Summary collapse
- #call(sha, access, blobs) ⇒ Object
-
#initialize(sort, direction_desc, limit) ⇒ WikiSorter
constructor
A new instance of WikiSorter.
Constructor Details
#initialize(sort, direction_desc, limit) ⇒ WikiSorter
Returns a new instance of WikiSorter.
8 9 10 11 12 |
# File 'lib/gollum-lib/sorters/wiki_sorter.rb', line 8 def initialize(sort, direction_desc, limit) @sort = sort @direction_desc = direction_desc @limit = limit end |
Instance Attribute Details
#direction_desc ⇒ Object (readonly)
Returns the value of attribute direction_desc.
6 7 8 |
# File 'lib/gollum-lib/sorters/wiki_sorter.rb', line 6 def direction_desc @direction_desc end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
6 7 8 |
# File 'lib/gollum-lib/sorters/wiki_sorter.rb', line 6 def limit @limit end |
#sort ⇒ Object (readonly)
Returns the value of attribute sort.
6 7 8 |
# File 'lib/gollum-lib/sorters/wiki_sorter.rb', line 6 def sort @sort end |
Instance Method Details
#call(sha, access, blobs) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/gollum-lib/sorters/wiki_sorter.rb', line 14 def call(sha, access, blobs) if sort == SORT_CREATED_AT by_created_at(sha, access, blobs) else by_title(blobs) end end |