Class: Prismic::Document
Instance Attribute Summary collapse
Instance Method Summary
collapse
#[], #as_html, #as_text, #each, #first_title, #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(id, uid, type, href, tags, slugs, first_publication_date, last_publication_date, fragments) ⇒ Document
Returns a new instance of Document
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
|
# File 'lib/prismic.rb', line 460
def initialize(
id,
uid,
type,
href,
tags,
slugs,
first_publication_date,
last_publication_date,
fragments
)
@id = id
@uid = uid
@type = type
@href = href
@tags = tags
@slugs = slugs
@first_publication_date = first_publication_date
@last_publication_date = last_publication_date
@fragments = fragments
end
|
Instance Attribute Details
#first_publication_date ⇒ Object
454
455
456
|
# File 'lib/prismic.rb', line 454
def first_publication_date
@first_publication_date
end
|
#fragments ⇒ Array<Fragment>
458
459
460
|
# File 'lib/prismic.rb', line 458
def fragments
@fragments
end
|
#href ⇒ String
448
449
450
|
# File 'lib/prismic.rb', line 448
def href
@href
end
|
#id ⇒ String
442
443
444
|
# File 'lib/prismic.rb', line 442
def id
@id
end
|
#last_publication_date ⇒ Object
456
457
458
|
# File 'lib/prismic.rb', line 456
def last_publication_date
@last_publication_date
end
|
#slugs ⇒ Array<String>
452
453
454
|
# File 'lib/prismic.rb', line 452
def slugs
@slugs
end
|
450
451
452
|
# File 'lib/prismic.rb', line 450
def tags
@tags
end
|
#type ⇒ String
446
447
448
|
# File 'lib/prismic.rb', line 446
def type
@type
end
|
#uid ⇒ String
444
445
446
|
# File 'lib/prismic.rb', line 444
def uid
@uid
end
|
Instance Method Details
#slug ⇒ String
Returns the document's slug
485
486
487
|
# File 'lib/prismic.rb', line 485
def slug
slugs.empty? ? '-' : slugs.first
end
|