Class: ParamsReady::Pagination::AbstractKeysets
- Inherits:
-
Object
- Object
- ParamsReady::Pagination::AbstractKeysets
- Defined in:
- lib/params_ready/pagination/keysets.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#keysets ⇒ Object
readonly
Returns the value of attribute keysets.
Instance Method Summary collapse
-
#initialize(keysets, &block) ⇒ AbstractKeysets
constructor
A new instance of AbstractKeysets.
- #length ⇒ Object
- #transform(raw) ⇒ Object
Constructor Details
#initialize(keysets, &block) ⇒ AbstractKeysets
Returns a new instance of AbstractKeysets.
6 7 8 9 |
# File 'lib/params_ready/pagination/keysets.rb', line 6 def initialize(keysets, &block) @keysets = keysets @transform = block end |
Instance Attribute Details
#keysets ⇒ Object (readonly)
Returns the value of attribute keysets.
4 5 6 |
# File 'lib/params_ready/pagination/keysets.rb', line 4 def keysets @keysets end |
Instance Method Details
#length ⇒ Object
11 12 13 |
# File 'lib/params_ready/pagination/keysets.rb', line 11 def length @keysets.length end |
#transform(raw) ⇒ Object
15 16 17 18 |
# File 'lib/params_ready/pagination/keysets.rb', line 15 def transform(raw) return raw if @transform.nil? @transform.call(raw) end |