Class: Hyrax::HomepagePresenter
- Inherits:
-
Object
- Object
- Hyrax::HomepagePresenter
- Defined in:
- app/presenters/hyrax/homepage_presenter.rb
Instance Attribute Summary collapse
-
#collections ⇒ Object
readonly
Returns the value of attribute collections.
-
#current_ability ⇒ Object
readonly
Returns the value of attribute current_ability.
Instance Method Summary collapse
-
#display_share_button? ⇒ Boolean
If the current user is a guest and the display_share_button_when_not_logged_in? is activated, then return true.
-
#initialize(current_ability, collections) ⇒ HomepagePresenter
constructor
A new instance of HomepagePresenter.
Constructor Details
#initialize(current_ability, collections) ⇒ HomepagePresenter
Returns a new instance of HomepagePresenter.
5 6 7 8 |
# File 'app/presenters/hyrax/homepage_presenter.rb', line 5 def initialize(current_ability, collections) @current_ability = current_ability @collections = collections end |
Instance Attribute Details
#collections ⇒ Object (readonly)
Returns the value of attribute collections.
3 4 5 |
# File 'app/presenters/hyrax/homepage_presenter.rb', line 3 def collections @collections end |
#current_ability ⇒ Object (readonly)
Returns the value of attribute current_ability.
3 4 5 |
# File 'app/presenters/hyrax/homepage_presenter.rb', line 3 def current_ability @current_ability end |
Instance Method Details
#display_share_button? ⇒ Boolean
Returns If the current user is a guest and the display_share_button_when_not_logged_in? is activated, then return true. Otherwise return true if the signed in user has permission to create at least one kind of work.
13 14 15 16 |
# File 'app/presenters/hyrax/homepage_presenter.rb', line 13 def (user_unregistered? && Hyrax.config.) || current_ability.can_create_any_work? end |