Class: Pageflow::HomeButton
- Inherits:
-
Object
- Object
- Pageflow::HomeButton
- Defined in:
- app/models/pageflow/home_button.rb
Instance Attribute Summary collapse
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
-
#site ⇒ Object
readonly
Returns the value of attribute site.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
- #enabled_value ⇒ Object
-
#initialize(revision, site) ⇒ HomeButton
constructor
A new instance of HomeButton.
- #url ⇒ Object
- #url_value ⇒ Object
Constructor Details
#initialize(revision, site) ⇒ HomeButton
Returns a new instance of HomeButton.
5 6 7 8 |
# File 'app/models/pageflow/home_button.rb', line 5 def initialize(revision, site) @revision = revision @site = site end |
Instance Attribute Details
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
3 4 5 |
# File 'app/models/pageflow/home_button.rb', line 3 def revision @revision end |
#site ⇒ Object (readonly)
Returns the value of attribute site.
3 4 5 |
# File 'app/models/pageflow/home_button.rb', line 3 def site @site end |
Instance Method Details
#enabled? ⇒ Boolean
14 15 16 17 18 |
# File 'app/models/pageflow/home_button.rb', line 14 def enabled? revision.configuration['home_button_enabled'] && revision.theme. && url.present? end |
#enabled_value ⇒ Object
24 25 26 |
# File 'app/models/pageflow/home_button.rb', line 24 def enabled_value revision.configuration['home_button_enabled'] end |
#url ⇒ Object
10 11 12 |
# File 'app/models/pageflow/home_button.rb', line 10 def url revision.configuration['home_url'].presence || end |
#url_value ⇒ Object
20 21 22 |
# File 'app/models/pageflow/home_button.rb', line 20 def url_value revision.configuration['home_url'] end |