Class: Hyrax::Admin::WorkflowsController::WorkflowResponse

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/hyrax/admin/workflows_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pageObject (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

#docsObject (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_pageObject (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_countObject (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_reviewObject (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_valueObject



70
71
72
# File 'app/controllers/hyrax/admin/workflows_controller.rb', line 70

def limit_value
  docs.length
end

#total_pagesObject



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

Returns:

  • (Boolean)


74
75
76
# File 'app/controllers/hyrax/admin/workflows_controller.rb', line 74

def viewing_under_review?
  under_review
end