Class: Ecoportal::API::GraphQL::Compat::PageReference
- Inherits:
-
Object
- Object
- Ecoportal::API::GraphQL::Compat::PageReference
- Defined in:
- lib/ecoportal/api/graphql/compat/page_reference.rb
Overview
Returned by Compat::Pages#create — mirrors the v2 reference object. Scripts access .page_id and .active_stage_id after page creation.
Instance Attribute Summary collapse
-
#active_stage_id ⇒ Object
readonly
Returns the value of attribute active_stage_id.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#page_id ⇒ Object
readonly
Returns the value of attribute page_id.
Instance Method Summary collapse
-
#initialize(page) ⇒ PageReference
constructor
A new instance of PageReference.
- #success? ⇒ Boolean
Constructor Details
#initialize(page) ⇒ PageReference
Returns a new instance of PageReference.
10 11 12 13 14 |
# File 'lib/ecoportal/api/graphql/compat/page_reference.rb', line 10 def initialize(page) @page = page @page_id = page.id @active_stage_id = page.respond_to?(:current_stage_id) ? page.current_stage_id : nil end |
Instance Attribute Details
#active_stage_id ⇒ Object (readonly)
Returns the value of attribute active_stage_id.
8 9 10 |
# File 'lib/ecoportal/api/graphql/compat/page_reference.rb', line 8 def active_stage_id @active_stage_id end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
8 9 10 |
# File 'lib/ecoportal/api/graphql/compat/page_reference.rb', line 8 def page @page end |
#page_id ⇒ Object (readonly)
Returns the value of attribute page_id.
8 9 10 |
# File 'lib/ecoportal/api/graphql/compat/page_reference.rb', line 8 def page_id @page_id end |
Instance Method Details
#success? ⇒ Boolean
16 17 18 |
# File 'lib/ecoportal/api/graphql/compat/page_reference.rb', line 16 def success? !@page_id.nil? end |