Class: Apadmi::Grout::ConfluencePage
- Inherits:
-
Struct
- Object
- Struct
- Apadmi::Grout::ConfluencePage
- Defined in:
- lib/apadmi/grout/models/confluence_page.rb
Overview
A model representing a Confluence page
Instance Attribute Summary collapse
-
#author_id ⇒ Object
Returns the value of attribute author_id.
-
#body ⇒ Object
Returns the value of attribute body.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_owner_id ⇒ Object
Returns the value of attribute last_owner_id.
-
#links ⇒ Object
Returns the value of attribute links.
-
#owner_id ⇒ Object
Returns the value of attribute owner_id.
-
#page_contents ⇒ Object
Returns the value of attribute page_contents.
-
#parent_id ⇒ Object
Returns the value of attribute parent_id.
-
#parent_type ⇒ Object
Returns the value of attribute parent_type.
-
#position ⇒ Object
Returns the value of attribute position.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#space_id ⇒ Object
Returns the value of attribute space_id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Attribute Details
#author_id ⇒ Object
Returns the value of attribute author_id
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def @author_id end |
#body ⇒ Object
Returns the value of attribute body
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def body @body end |
#created_at ⇒ Object
Returns the value of attribute created_at
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def id @id end |
#last_owner_id ⇒ Object
Returns the value of attribute last_owner_id
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def last_owner_id @last_owner_id end |
#links ⇒ Object
Returns the value of attribute links
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def links @links end |
#owner_id ⇒ Object
Returns the value of attribute owner_id
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def owner_id @owner_id end |
#page_contents ⇒ Object
Returns the value of attribute page_contents
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def page_contents @page_contents end |
#parent_id ⇒ Object
Returns the value of attribute parent_id
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def parent_id @parent_id end |
#parent_type ⇒ Object
Returns the value of attribute parent_type
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def parent_type @parent_type end |
#position ⇒ Object
Returns the value of attribute position
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def position @position end |
#raw ⇒ Object
Returns the value of attribute raw
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def raw @raw end |
#space_id ⇒ Object
Returns the value of attribute space_id
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def space_id @space_id end |
#status ⇒ Object
Returns the value of attribute status
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def status @status end |
#title ⇒ Object
Returns the value of attribute title
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def title @title end |
#url ⇒ Object
Returns the value of attribute url
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def url @url end |
#version ⇒ Object
Returns the value of attribute version
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def version @version end |
Class Method Details
.from_hash(hash, base_url = nil) ⇒ Apadmi::Grout::ConfluencePage
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 46 def self.from_hash(hash, base_url = nil) space_id = hash["spaceId"] || hash.dig("space", "id") parent_id = hash["parentId"] || hash.dig("ancestors", -1, "id") base = base_url || hash.dig("_links", "base") webui = hash.dig("_links", "webui") url = base && webui ? base + webui : nil page_contents = hash.dig("body", "value") || hash.dig("body", "storage", "value") ConfluencePage.new( hash["id"], hash["title"], hash["version"], space_id, parent_id, hash["parentType"], hash["ownerId"], hash["lastOwnerId"], hash["createdAt"], hash["authorId"], hash["position"], hash["body"], hash["status"], hash["_links"], url, page_contents, hash ) end |