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 ⇒ String
Returns the value of attribute author_id.
-
#body ⇒ Hash
Returns the value of attribute body.
-
#created_at ⇒ String
Returns the value of attribute created_at.
-
#id ⇒ String
Returns the value of attribute id.
-
#last_owner_id ⇒ String
Returns the value of attribute last_owner_id.
-
#links ⇒ Hash
Returns the value of attribute links.
-
#owner_id ⇒ String
Returns the value of attribute owner_id.
-
#page_contents ⇒ String
Returns the value of attribute page_contents.
-
#parent_id ⇒ String
Returns the value of attribute parent_id.
-
#parent_type ⇒ String
Returns the value of attribute parent_type.
-
#position ⇒ Integer
Returns the value of attribute position.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#space_id ⇒ String
Returns the value of attribute space_id.
-
#status ⇒ String
Returns the value of attribute status.
-
#title ⇒ String
Returns the value of attribute title.
-
#url ⇒ String
Returns the value of attribute url.
-
#version ⇒ Hash
Returns the value of attribute version.
Class Method Summary collapse
Instance Attribute Details
#author_id ⇒ String
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 ⇒ Hash
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 ⇒ String
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 ⇒ String
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 ⇒ String
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 ⇒ Hash
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 ⇒ String
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 ⇒ String
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 ⇒ String
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 ⇒ String
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 ⇒ Integer
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 ⇒ String
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 ⇒ String
Returns the value of attribute status
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def status @status end |
#title ⇒ String
Returns the value of attribute title
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def title @title end |
#url ⇒ String
Returns the value of attribute url
22 23 24 |
# File 'lib/apadmi/grout/models/confluence_page.rb', line 22 def url @url end |
#version ⇒ Hash
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 |