Class: Hyrax::Admin::WorkflowsController::WorkflowResponse
- Inherits:
-
Object
- Object
- Hyrax::Admin::WorkflowsController::WorkflowResponse
- Defined in:
- app/controllers/hyrax/admin/workflows_controller.rb
Instance Attribute Summary collapse
-
#current_page ⇒ Object
readonly
Returns the value of attribute current_page.
-
#docs ⇒ Object
readonly
Returns the value of attribute docs.
-
#per_page ⇒ Object
readonly
Returns the value of attribute per_page.
-
#total_count ⇒ Object
readonly
Returns the value of attribute total_count.
-
#under_review ⇒ Object
readonly
Returns the value of attribute under_review.
Instance Method Summary collapse
-
#initialize(docs, total_count, page, per_page, under_review) ⇒ WorkflowResponse
constructor
A new instance of WorkflowResponse.
- #limit_value ⇒ Object
- #total_pages ⇒ Object
- #viewing_under_review? ⇒ Boolean
Constructor Details
#initialize(docs, total_count, page, per_page, under_review) ⇒ WorkflowResponse
Returns a new instance of WorkflowResponse.
58 59 60 61 62 63 64 |
# File 'app/controllers/hyrax/admin/workflows_controller.rb', line 58 def initialize(docs, total_count, page, per_page, under_review) @docs = docs @total_count = total_count @per_page = per_page.to_i @current_page = page.to_i @under_review = under_review end |
Instance Attribute Details
#current_page ⇒ Object (readonly)
Returns the value of attribute current_page.
53 54 55 |
# File 'app/controllers/hyrax/admin/workflows_controller.rb', line 53 def current_page @current_page end |
#docs ⇒ Object (readonly)
Returns the value of attribute docs.
55 56 57 |
# File 'app/controllers/hyrax/admin/workflows_controller.rb', line 55 def docs @docs end |
#per_page ⇒ Object (readonly)
Returns the value of attribute per_page.
54 55 56 |
# File 'app/controllers/hyrax/admin/workflows_controller.rb', line 54 def per_page @per_page end |
#total_count ⇒ Object (readonly)
Returns the value of attribute total_count.
52 53 54 |
# File 'app/controllers/hyrax/admin/workflows_controller.rb', line 52 def total_count @total_count end |
#under_review ⇒ Object (readonly)
Returns the value of attribute under_review.
56 57 58 |
# File 'app/controllers/hyrax/admin/workflows_controller.rb', line 56 def under_review @under_review end |
Instance Method Details
#limit_value ⇒ Object
70 71 72 |
# File 'app/controllers/hyrax/admin/workflows_controller.rb', line 70 def limit_value docs.length end |
#total_pages ⇒ Object
66 67 68 |
# File 'app/controllers/hyrax/admin/workflows_controller.rb', line 66 def total_pages (total_count.to_f / per_page).ceil end |
#viewing_under_review? ⇒ Boolean
74 75 76 |
# File 'app/controllers/hyrax/admin/workflows_controller.rb', line 74 def viewing_under_review? under_review end |