Class: WCC::Blogs::LinkedBlogPostSummary

Inherits:
Object
  • Object
show all
Extended by:
Utils
Defined in:
lib/wcc/blogs/linked_blog_post_summary.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

camelcase, define_camelcase_alias

Constructor Details

#initialize(raw, client: WCC::Blogs.client) ⇒ LinkedBlogPostSummary

Returns a new instance of LinkedBlogPostSummary.



9
10
11
12
# File 'lib/wcc/blogs/linked_blog_post_summary.rb', line 9

def initialize(raw, client: WCC::Blogs.client)
  @raw = raw
  @client = client
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



7
8
9
# File 'lib/wcc/blogs/linked_blog_post_summary.rb', line 7

def raw
  @raw
end

Instance Method Details



34
35
36
# File 'lib/wcc/blogs/linked_blog_post_summary.rb', line 34

def _links
  OpenStruct.new(raw['_links'] || {})
end

#full_postObject



14
15
16
# File 'lib/wcc/blogs/linked_blog_post_summary.rb', line 14

def full_post
  Post.new(@client.get(_links.self).raw, client: @client)
end