Class: Zoho::Api::HostedPage
- Defined in:
- lib/zoho/api/hosted_pages.rb
Instance Attribute Summary collapse
-
#addons ⇒ Object
Returns the value of attribute addons.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#plan ⇒ Object
Returns the value of attribute plan.
-
#redirect_url ⇒ Object
Returns the value of attribute redirect_url.
-
#subscription_id ⇒ Object
Returns the value of attribute subscription_id.
Class Method Summary collapse
- .all ⇒ Object
- .buy_onetime_addon(attrs = {}) ⇒ Object
- .create_subscription(attrs = {}) ⇒ Object
- .find(page_id) ⇒ Object
Instance Method Summary collapse
Methods inherited from Request
#attributes, #delete, delete, #get, get, #initialize, #post, post, #put, put
Constructor Details
This class inherits a constructor from Zoho::Request
Instance Attribute Details
#addons ⇒ Object
Returns the value of attribute addons.
2 3 4 |
# File 'lib/zoho/api/hosted_pages.rb', line 2 def addons @addons end |
#customer ⇒ Object
Returns the value of attribute customer.
2 3 4 |
# File 'lib/zoho/api/hosted_pages.rb', line 2 def customer @customer end |
#plan ⇒ Object
Returns the value of attribute plan.
2 3 4 |
# File 'lib/zoho/api/hosted_pages.rb', line 2 def plan @plan end |
#redirect_url ⇒ Object
Returns the value of attribute redirect_url.
2 3 4 |
# File 'lib/zoho/api/hosted_pages.rb', line 2 def redirect_url @redirect_url end |
#subscription_id ⇒ Object
Returns the value of attribute subscription_id.
2 3 4 |
# File 'lib/zoho/api/hosted_pages.rb', line 2 def subscription_id @subscription_id end |
Class Method Details
.all ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/zoho/api/hosted_pages.rb', line 20 def all base_url = Zoho::Api::HOST+"/api/v1/hostedpages" response = Zoho::Request.get(base_url) if response.code == 0 return response.hostedpages else return response end end |
.buy_onetime_addon(attrs = {}) ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/zoho/api/hosted_pages.rb', line 45 def buy_onetime_addon attrs={} hostpage = Zoho::Api::HostedPage.new(attrs) base_url = Zoho::Api::HOST+"/api/v1/hostedpages/buyonetimeaddon" response = post(base_url) do |http, request| request.body = hostpage.to_json response = http.request(request) response = JSON.parse(response.body, object_class: OpenStruct) end return response end |
.create_subscription(attrs = {}) ⇒ Object
40 41 42 43 |
# File 'lib/zoho/api/hosted_pages.rb', line 40 def create_subscription attrs={} hostpage = Zoho::Api::HostedPage.new(attrs) return hostpage.save end |
Instance Method Details
#find(hostpage_id) ⇒ Object
15 16 17 |
# File 'lib/zoho/api/hosted_pages.rb', line 15 def find hostpage_id return Zoho::Api::HostedPage.find(hostpage_id) end |
#save ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/zoho/api/hosted_pages.rb', line 4 def save base_url = Zoho::Api::HOST+"/api/v1/hostedpages/newsubscription" response = post(base_url) do |http, request| request.body = self.to_json response = http.request(request) response = JSON.parse(response.body, object_class: OpenStruct) end return response end |