Module: Nanoc::WithRepsViewMixin
- Included in:
- ItemWithRepsView
- Defined in:
- lib/nanoc/base/views/mixins/with_reps_view_mixin.rb
Instance Method Summary collapse
-
#compiled_content(rep: :default, snapshot: nil) ⇒ String
Returns the compiled content.
-
#path(rep: :default, snapshot: :last) ⇒ String
Returns the item path, as used when being linked to.
-
#reps ⇒ Nanoc::ItemRepCollectionView
Returns the representations of this item.
Instance Method Details
#compiled_content(rep: :default, snapshot: nil) ⇒ String
Returns the compiled content.
17 18 19 |
# File 'lib/nanoc/base/views/mixins/with_reps_view_mixin.rb', line 17 def compiled_content(rep: :default, snapshot: nil) reps.fetch(rep).compiled_content(snapshot: snapshot) end |
#path(rep: :default, snapshot: :last) ⇒ String
Returns the item path, as used when being linked to. It starts with a slash and it is relative to the output directory. It does not include the path to the output directory. It will not include the filename if the filename is an index filename.
34 35 36 |
# File 'lib/nanoc/base/views/mixins/with_reps_view_mixin.rb', line 34 def path(rep: :default, snapshot: :last) reps.fetch(rep).path(snapshot: snapshot) end |
#reps ⇒ Nanoc::ItemRepCollectionView
Returns the representations of this item.
41 42 43 |
# File 'lib/nanoc/base/views/mixins/with_reps_view_mixin.rb', line 41 def reps Nanoc::ItemRepCollectionView.new(@context.reps[unwrap], @context) end |