Class: Lcms::Engine::Slug
- Inherits:
-
Object
- Object
- Lcms::Engine::Slug
- Defined in:
- app/entities/lcms/engine/slug.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(resource) ⇒ Slug
constructor
A new instance of Slug.
- #value ⇒ Object
Constructor Details
#initialize(resource) ⇒ Slug
Returns a new instance of Slug.
8 9 10 |
# File 'app/entities/lcms/engine/slug.rb', line 8 def initialize(resource) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
6 7 8 |
# File 'app/entities/lcms/engine/slug.rb', line 6 def resource @resource end |
Class Method Details
.build_from(chain) ⇒ Object
16 17 18 |
# File 'app/entities/lcms/engine/slug.rb', line 16 def self.build_from(chain) chain.map(&:parameterize).join('/') end |
Instance Method Details
#value ⇒ Object
12 13 14 |
# File 'app/entities/lcms/engine/slug.rb', line 12 def value self.class.build_from(resource.directory) end |