Class: Prismic::Fragments::GroupDocument

Inherits:
Object
  • Object
show all
Includes:
WithFragments
Defined in:
lib/prismic/fragments/group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WithFragments

#as_html, #as_text, #each, #first_title, #get_boolean_field, #get_color, #get_date, #get_embed, #get_geopoint, #get_group, #get_image, #get_link, #get_number, #get_slice_zone, #get_structured_text, #get_text, #get_timestamp, #length, #linked_documents

Constructor Details

#initialize(fragments) ⇒ GroupDocument

Returns a new instance of GroupDocument.



9
10
11
# File 'lib/prismic/fragments/group.rb', line 9

def initialize(fragments)
  @fragments = fragments
end

Instance Attribute Details

#fragmentsObject

Returns the value of attribute fragments.



7
8
9
# File 'lib/prismic/fragments/group.rb', line 7

def fragments
  @fragments
end

Instance Method Details

#[](field) ⇒ Fragments::Fragment Also known as: get

Get a document's field

Returns:



15
16
17
# File 'lib/prismic/fragments/group.rb', line 15

def [](field)
  @fragments[field]
end