Class: WCC::Blogs::CollectionSummary
- Inherits:
-
Object
- Object
- WCC::Blogs::CollectionSummary
- Extended by:
- Utils
- Defined in:
- lib/wcc/blogs/collection_summary.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
-
#initialize(raw, client: WCC::Blogs.client) ⇒ CollectionSummary
constructor
A new instance of CollectionSummary.
- #posts ⇒ Object
Methods included from Utils
camelcase, define_camelcase_alias
Constructor Details
#initialize(raw, client: WCC::Blogs.client) ⇒ CollectionSummary
Returns a new instance of CollectionSummary.
9 10 11 12 |
# File 'lib/wcc/blogs/collection_summary.rb', line 9 def initialize(raw, client: WCC::Blogs.client) @raw = raw @client = client end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
7 8 9 |
# File 'lib/wcc/blogs/collection_summary.rb', line 7 def raw @raw end |
Instance Method Details
#posts ⇒ Object
21 22 23 24 25 26 |
# File 'lib/wcc/blogs/collection_summary.rb', line 21 def posts @posts ||= (raw['posts'] || []).map do |summary| WCC::Blogs::LinkedBlogPostSummary.new(summary, client: @client) end end |