Class: Prismic::Fragments::SliceZone
- Defined in:
- lib/prismic/fragments/slices.rb
Instance Attribute Summary collapse
-
#slices ⇒ Object
Returns the value of attribute slices.
Instance Method Summary collapse
-
#as_html(link_resolver = nil) ⇒ String
Generate an HTML representation of the group.
-
#as_text ⇒ String
Generate an text representation of the group.
-
#initialize(slices) ⇒ SliceZone
constructor
A new instance of SliceZone.
Constructor Details
#initialize(slices) ⇒ SliceZone
Returns a new instance of SliceZone.
91 92 93 |
# File 'lib/prismic/fragments/slices.rb', line 91 def initialize(slices) @slices = slices end |
Instance Attribute Details
#slices ⇒ Object
Returns the value of attribute slices.
89 90 91 |
# File 'lib/prismic/fragments/slices.rb', line 89 def slices @slices end |
Instance Method Details
#as_html(link_resolver = nil) ⇒ String
Generate an HTML representation of the group
108 109 110 |
# File 'lib/prismic/fragments/slices.rb', line 108 def as_html(link_resolver=nil) @slices.map { |slice| slice.as_html(link_resolver) }.join("\n") end |
#as_text ⇒ String
Generate an text representation of the group
98 99 100 |
# File 'lib/prismic/fragments/slices.rb', line 98 def as_text @slices.map { |slice| slice.as_text }.join("\n") end |