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
42 43 44 |
# File 'lib/prismic/fragments/slices.rb', line 42 def initialize(slices) @slices = slices end |
Instance Attribute Details
#slices ⇒ Object
Returns the value of attribute slices
40 41 42 |
# File 'lib/prismic/fragments/slices.rb', line 40 def slices @slices end |
Instance Method Details
#as_html(link_resolver = nil) ⇒ String
Generate an HTML representation of the group
59 60 61 |
# File 'lib/prismic/fragments/slices.rb', line 59 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
49 50 51 |
# File 'lib/prismic/fragments/slices.rb', line 49 def as_text @slices.map { |slice| slice.as_text }.join("\n") end |