Class: PactBroker::UI::ViewDomain::IndexItems
- Inherits:
-
Object
- Object
- PactBroker::UI::ViewDomain::IndexItems
- Defined in:
- lib/pact_broker/ui/view_models/index_items.rb
Instance Attribute Summary collapse
-
#pagination_record_count ⇒ Object
readonly
Returns the value of attribute pagination_record_count.
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(index_items, options = {}) ⇒ IndexItems
constructor
A new instance of IndexItems.
- #size ⇒ Object
Constructor Details
#initialize(index_items, options = {}) ⇒ IndexItems
Returns a new instance of IndexItems.
10 11 12 13 14 15 16 |
# File 'lib/pact_broker/ui/view_models/index_items.rb', line 10 def initialize index_items, = {} # Why are we sorting twice!? @index_items = index_items.collect{ |index_item| IndexItem.new(index_item, ) }.sort # until the feature flag is turned on @pagination_record_count = index_items.size @pagination_record_count = index_items.pagination_record_count if index_items.respond_to?(:pagination_record_count) end |
Instance Attribute Details
#pagination_record_count ⇒ Object (readonly)
Returns the value of attribute pagination_record_count.
8 9 10 |
# File 'lib/pact_broker/ui/view_models/index_items.rb', line 8 def pagination_record_count @pagination_record_count end |
Instance Method Details
#each(&block) ⇒ Object
18 19 20 |
# File 'lib/pact_broker/ui/view_models/index_items.rb', line 18 def each(&block) index_items.each(&block) end |
#empty? ⇒ Boolean
22 23 24 |
# File 'lib/pact_broker/ui/view_models/index_items.rb', line 22 def empty? index_items.empty? end |
#size ⇒ Object
26 27 28 |
# File 'lib/pact_broker/ui/view_models/index_items.rb', line 26 def size index_items.size end |