class Weeblycloud::Page
Represents a Page
resource. cloud-developer.weebly.com/page.html
Public Class Methods
new(user_id, site_id, page_id, data = nil)
click to toggle source
Calls superclass method
Weeblycloud::CloudResource::new
# File lib/weeblycloud/page.rb, line 9 def initialize(user_id, site_id, page_id, data = nil) @user_id = user_id.to_i @site_id = site_id.to_i @page_id = page_id.to_i @endpoint = "user/#{@user_id}/site/#{@site_id}/page/#{@page_id}" super(data) end
Public Instance Methods
change_title(title)
click to toggle source
Changes the title of the page to title. Does not require calling the save() method.
# File lib/weeblycloud/page.rb, line 26 def change_title(title) data = {"title"=>title} response = @client.patch(@endpoint, :content=>data) if response.json["title"] == title return true else return false end end
id()
click to toggle source
Returns the page_id
# File lib/weeblycloud/page.rb, line 20 def id @page_id end