Class: ActivePermalink::Localizer::PermalinkReader
- Inherits:
-
Object
- Object
- ActivePermalink::Localizer::PermalinkReader
- Defined in:
- lib/active_permalink/localizer.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#permalinks ⇒ Object
readonly
Returns the value of attribute permalinks.
Instance Method Summary collapse
- #exists? ⇒ Boolean
- #fallbacks? ⇒ Boolean
-
#initialize(permalinks, options) ⇒ PermalinkReader
constructor
A new instance of PermalinkReader.
- #value ⇒ Object
Constructor Details
#initialize(permalinks, options) ⇒ PermalinkReader
Returns a new instance of PermalinkReader.
36 37 38 39 |
# File 'lib/active_permalink/localizer.rb', line 36 def initialize(permalinks, ) @permalinks = permalinks = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
34 35 36 |
# File 'lib/active_permalink/localizer.rb', line 34 def end |
#permalinks ⇒ Object (readonly)
Returns the value of attribute permalinks.
34 35 36 |
# File 'lib/active_permalink/localizer.rb', line 34 def permalinks @permalinks end |
Instance Method Details
#exists? ⇒ Boolean
45 46 47 |
# File 'lib/active_permalink/localizer.rb', line 45 def exists? find_permalink(I18n.locale).present? end |
#fallbacks? ⇒ Boolean
41 42 43 |
# File 'lib/active_permalink/localizer.rb', line 41 def fallbacks? [:fallbacks].present? end |
#value ⇒ Object
49 50 51 |
# File 'lib/active_permalink/localizer.rb', line 49 def value find_slug(I18n.locale) end |