Class: Prismic::Ref

Inherits:
Object
  • Object
show all
Defined in:
lib/prismic.rb

Overview

Represent a prismic.io reference, a fix point in time.

The references must be provided when accessing to any prismic.io resource (except /api) and allow to assert that the URL you use will always returns the same results.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, ref, label, is_master = false, scheduled_at = nil) ⇒ Ref

Returns a new instance of Ref.



546
547
548
549
550
551
552
# File 'lib/prismic.rb', line 546

def initialize(id, ref, label, is_master = false, scheduled_at = nil)
  @id = id
  @ref = ref
  @label = label
  @is_master = is_master
  @scheduled_at = scheduled_at
end

Instance Attribute Details

#idString

Returns the value of attribute id.

Returns:

  • (String)


524
525
526
# File 'lib/prismic.rb', line 524

def id
  @id
end

#is_masterBoolean Also known as: master?

Returns the value of attribute is_master.

Returns:

  • (Boolean)


539
540
541
# File 'lib/prismic.rb', line 539

def is_master
  @is_master
end

#labelString

Returns the value of attribute label.

Returns:

  • (String)


534
535
536
# File 'lib/prismic.rb', line 534

def label
  @label
end

#refString

Returns the value of attribute ref.

Returns:

  • (String)


529
530
531
# File 'lib/prismic.rb', line 529

def ref
  @ref
end

#scheduled_atTime

Returns the value of attribute scheduled_at.

Returns:

  • (Time)


544
545
546
# File 'lib/prismic.rb', line 544

def scheduled_at
  @scheduled_at
end