Class: HammerCLI::Output::MetaData
- Inherits:
-
Object
- Object
- HammerCLI::Output::MetaData
- Defined in:
- lib/hammer_cli/output/record_collection.rb
Instance Attribute Summary collapse
-
#page ⇒ Object
Returns the value of attribute page.
-
#pagination_verbosity ⇒ Object
Returns the value of attribute pagination_verbosity.
-
#per_page ⇒ Object
Returns the value of attribute per_page.
-
#search ⇒ Object
Returns the value of attribute search.
-
#sort_by ⇒ Object
Returns the value of attribute sort_by.
-
#sort_order ⇒ Object
Returns the value of attribute sort_order.
-
#subtotal ⇒ Object
Returns the value of attribute subtotal.
-
#total ⇒ Object
Returns the value of attribute total.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ MetaData
constructor
A new instance of MetaData.
- #pagination_set? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ MetaData
Returns a new instance of MetaData.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/hammer_cli/output/record_collection.rb', line 8 def initialize(={}) @total = [:total].to_i if [:total] @subtotal = [:subtotal].to_i if [:subtotal] @page = [:page].to_i if [:page] @per_page = [:per_page].to_i if [:per_page] @search = [:search] @sort_by = [:sort_by] @sort_order = [:sort_order] @pagination_verbosity = [:pagination_verbosity] || HammerCLI::V_VERBOSE end |
Instance Attribute Details
#page ⇒ Object
Returns the value of attribute page.
6 7 8 |
# File 'lib/hammer_cli/output/record_collection.rb', line 6 def page @page end |
#pagination_verbosity ⇒ Object
Returns the value of attribute pagination_verbosity.
6 7 8 |
# File 'lib/hammer_cli/output/record_collection.rb', line 6 def pagination_verbosity @pagination_verbosity end |
#per_page ⇒ Object
Returns the value of attribute per_page.
6 7 8 |
# File 'lib/hammer_cli/output/record_collection.rb', line 6 def per_page @per_page end |
#search ⇒ Object
Returns the value of attribute search.
6 7 8 |
# File 'lib/hammer_cli/output/record_collection.rb', line 6 def search @search end |
#sort_by ⇒ Object
Returns the value of attribute sort_by.
6 7 8 |
# File 'lib/hammer_cli/output/record_collection.rb', line 6 def sort_by @sort_by end |
#sort_order ⇒ Object
Returns the value of attribute sort_order.
6 7 8 |
# File 'lib/hammer_cli/output/record_collection.rb', line 6 def sort_order @sort_order end |
#subtotal ⇒ Object
Returns the value of attribute subtotal.
6 7 8 |
# File 'lib/hammer_cli/output/record_collection.rb', line 6 def subtotal @subtotal end |
#total ⇒ Object
Returns the value of attribute total.
6 7 8 |
# File 'lib/hammer_cli/output/record_collection.rb', line 6 def total @total end |
Instance Method Details
#pagination_set? ⇒ Boolean
19 20 21 |
# File 'lib/hammer_cli/output/record_collection.rb', line 19 def pagination_set? !(@total.nil? || @subtotal.nil? || @page.nil? || @per_page.nil?) end |