Class: Weeblycloud::BlogPost

Inherits:
CloudResource show all
Includes:
Deleteable, Saveable
Defined in:
lib/weeblycloud/blogpost.rb

Overview

Represents a BlogPost resource. cloud-developer.weebly.com/blog-post.html

Instance Attribute Summary

Attributes inherited from CloudResource

#properties

Instance Method Summary collapse

Methods included from Deleteable

#delete

Methods included from Saveable

#[]=, #save, #set_property

Methods inherited from CloudResource

#[], #get, #get_property, #to_s

Constructor Details

#initialize(user_id, site_id, blog_id, blog_post_id, data = nil) ⇒ BlogPost

Returns a new instance of BlogPost.



12
13
14
15
16
17
18
19
20
# File 'lib/weeblycloud/blogpost.rb', line 12

def initialize(user_id, site_id, blog_id, blog_post_id, data = nil)
  @user_id = user_id.to_i
  @site_id = site_id.to_i
  @blog_id = blog_id.to_i
  @blog_post_id = blog_post_id.to_i
  @endpoint = "user/#{@user_id}/site/#{@site_id}/blog/#{@blog_id}/post/#{@blog_post_id}"

  super(data)
end

Instance Method Details

#idObject

Returns the blog_post_id



23
24
25
# File 'lib/weeblycloud/blogpost.rb', line 23

def id
  @blog_post_id
end