class PrismicRails::Fragment

The PrismicRails::Fragment is a wrapper class around Prismic::Fragment

Attributes

fragment[R]

Public Class Methods

new(fragment) click to toggle source

Create a new instance of PrismicRails::Fragment

+fragment+ A Prismic::Fragment
# File lib/prismic_rails/content/fragment.rb, line 9
def initialize(fragment)
  @fragment = fragment
end

Public Instance Methods

as_html(serializer = nil) click to toggle source

Returns the document as safe html

# File lib/prismic_rails/content/fragment.rb, line 14
def as_html(serializer = nil)
  @fragment.as_html(serializer)
end
as_text() click to toggle source

Returns only the text of a document

# File lib/prismic_rails/content/fragment.rb, line 19
def as_text
  @fragment.as_text
end