class Weeblycloud::Form
Represents a Form
resource. cloud-developer.weebly.com/form.html
Public Class Methods
new(user_id, site_id, form_id, data = nil)
click to toggle source
Calls superclass method
Weeblycloud::CloudResource::new
# File lib/weeblycloud/form.rb, line 11 def initialize(user_id, site_id, form_id, data = nil) @user_id = user_id.to_i @site_id = site_id.to_i @form_id = form_id.to_i @endpoint = "user/#{@user_id}/site/#{@site_id}/form/#{@form_id}" super(data) end
Public Instance Methods
get_form_entry(form_entry_id)
click to toggle source
Return the FormEntry
with the given id.
# File lib/weeblycloud/form.rb, line 33 def get_form_entry(form_entry_id) return FormEntry.new(@user_id, @site_id, @form_id, @form_entry_id) end
id()
click to toggle source
Returns the form_id
# File lib/weeblycloud/form.rb, line 22 def id @form_id end
list_form_entries(filters={})
click to toggle source
Returns a list of FormEntry
resources for a given form subject to filters.
# File lib/weeblycloud/form.rb, line 27 def list_form_entries(filters={}) result = @client.get(@endpoint + "/entry", :params=>filters) return result.map { |i| FormEntry.new(@user_id, @site_id, i["form_entry_id"], i) } end