Class: Instamojo::Link
- Inherits:
-
Object
- Object
- Instamojo::Link
- Includes:
- CommonObject
- Defined in:
- lib/client/link.rb
Overview
"title" => "Foo product",
"description" => "",
"slug" => "foo-product",
"shorturl" => "http://imojo.in/ankurfoobar",
"url" => "https://www.instamojo.com/ankurgel/foo-product/",
"cover_image" => "https://www.filepicker.io/api/file/BHeefKAARCKGC5l1J29e/convert?w=500&h=500&fit=clip&quality=70",
"currency" => "INR",
"base_price" => "0.00",
"quantity" => nil,
"quantity_sold" => 2,
"requires_shipping" => false,
"ships_within_days" => nil,
"start_date" => nil,
"end_date" => nil,
"venue" => nil,
"timezone" => nil,
"note" => nil,
"redirect_url" => nil,
"webhook_url" => nil,
"status" => "Live",
"enable_pwyw" => false,
"enable_sign" => false,
"socialpay_platforms" => ""
Instance Attribute Summary collapse
-
#base_price ⇒ Object
Returns the value of attribute base_price.
-
#cover_image ⇒ Object
Returns the value of attribute cover_image.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#description ⇒ Object
Returns the value of attribute description.
-
#enable_pwyw ⇒ Object
Returns the value of attribute enable_pwyw.
-
#enable_sign ⇒ Object
Returns the value of attribute enable_sign.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#note ⇒ Object
Returns the value of attribute note.
-
#original ⇒ Object
readonly
Returns the value of attribute original.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#quantity_sold ⇒ Object
Returns the value of attribute quantity_sold.
-
#redirect_url ⇒ Object
Returns the value of attribute redirect_url.
-
#requires_shipping ⇒ Object
Returns the value of attribute requires_shipping.
-
#ships_within_days ⇒ Object
Returns the value of attribute ships_within_days.
-
#shorturl ⇒ Object
Returns the value of attribute shorturl.
-
#slug ⇒ Object
Returns the value of attribute slug.
-
#socialpay_platforms ⇒ Object
Returns the value of attribute socialpay_platforms.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#status ⇒ Object
Returns the value of attribute status.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
-
#venue ⇒ Object
Returns the value of attribute venue.
-
#webhook_url ⇒ Object
Returns the value of attribute webhook_url.
Instance Method Summary collapse
-
#archive ⇒ Object
Carry out DELETE request on a link.
-
#initialize(link, client) ⇒ Link
constructor
A new instance of Link.
-
#save(&block) ⇒ Object
Carry out update request on a Link.
- #to_s ⇒ Object
Methods included from CommonObject
#assign_values, #construct_hash, included, #reload, #reload!, #to_h, #to_json
Constructor Details
#initialize(link, client) ⇒ Link
Returns a new instance of Link.
41 42 43 44 |
# File 'lib/client/link.rb', line 41 def initialize(link, client) assign_values(link) @client = client # Reference to client end |
Instance Attribute Details
#base_price ⇒ Object
Returns the value of attribute base_price.
32 33 34 |
# File 'lib/client/link.rb', line 32 def base_price @base_price end |
#cover_image ⇒ Object
Returns the value of attribute cover_image.
32 33 34 |
# File 'lib/client/link.rb', line 32 def cover_image @cover_image end |
#currency ⇒ Object
Returns the value of attribute currency.
32 33 34 |
# File 'lib/client/link.rb', line 32 def currency @currency end |
#description ⇒ Object
Returns the value of attribute description.
32 33 34 |
# File 'lib/client/link.rb', line 32 def description @description end |
#enable_pwyw ⇒ Object
Returns the value of attribute enable_pwyw.
34 35 36 |
# File 'lib/client/link.rb', line 34 def enable_pwyw @enable_pwyw end |
#enable_sign ⇒ Object
Returns the value of attribute enable_sign.
34 35 36 |
# File 'lib/client/link.rb', line 34 def enable_sign @enable_sign end |
#end_date ⇒ Object
Returns the value of attribute end_date.
33 34 35 |
# File 'lib/client/link.rb', line 33 def end_date @end_date end |
#note ⇒ Object
Returns the value of attribute note.
34 35 36 |
# File 'lib/client/link.rb', line 34 def note @note end |
#original ⇒ Object (readonly)
Returns the value of attribute original.
36 37 38 |
# File 'lib/client/link.rb', line 36 def original @original end |
#quantity ⇒ Object
Returns the value of attribute quantity.
32 33 34 |
# File 'lib/client/link.rb', line 32 def quantity @quantity end |
#quantity_sold ⇒ Object
Returns the value of attribute quantity_sold.
33 34 35 |
# File 'lib/client/link.rb', line 33 def quantity_sold @quantity_sold end |
#redirect_url ⇒ Object
Returns the value of attribute redirect_url.
34 35 36 |
# File 'lib/client/link.rb', line 34 def redirect_url @redirect_url end |
#requires_shipping ⇒ Object
Returns the value of attribute requires_shipping.
33 34 35 |
# File 'lib/client/link.rb', line 33 def requires_shipping @requires_shipping end |
#ships_within_days ⇒ Object
Returns the value of attribute ships_within_days.
33 34 35 |
# File 'lib/client/link.rb', line 33 def ships_within_days @ships_within_days end |
#shorturl ⇒ Object
Returns the value of attribute shorturl.
32 33 34 |
# File 'lib/client/link.rb', line 32 def shorturl @shorturl end |
#slug ⇒ Object
Returns the value of attribute slug.
32 33 34 |
# File 'lib/client/link.rb', line 32 def slug @slug end |
#socialpay_platforms ⇒ Object
Returns the value of attribute socialpay_platforms.
34 35 36 |
# File 'lib/client/link.rb', line 34 def @socialpay_platforms end |
#start_date ⇒ Object
Returns the value of attribute start_date.
33 34 35 |
# File 'lib/client/link.rb', line 33 def start_date @start_date end |
#status ⇒ Object
Returns the value of attribute status.
34 35 36 |
# File 'lib/client/link.rb', line 34 def status @status end |
#timezone ⇒ Object
Returns the value of attribute timezone.
33 34 35 |
# File 'lib/client/link.rb', line 33 def timezone @timezone end |
#title ⇒ Object
Returns the value of attribute title.
32 33 34 |
# File 'lib/client/link.rb', line 32 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
32 33 34 |
# File 'lib/client/link.rb', line 32 def url @url end |
#venue ⇒ Object
Returns the value of attribute venue.
33 34 35 |
# File 'lib/client/link.rb', line 33 def venue @venue end |
#webhook_url ⇒ Object
Returns the value of attribute webhook_url.
34 35 36 |
# File 'lib/client/link.rb', line 34 def webhook_url @webhook_url end |
Instance Method Details
#archive ⇒ Object
Carry out DELETE request on a link
52 53 54 |
# File 'lib/client/link.rb', line 52 def archive @client.archive_link(self.slug) end |
#save(&block) ⇒ Object
Carry out update request on a Link
47 48 49 |
# File 'lib/client/link.rb', line 47 def save(&block) @client.edit_link(self, {}, &block) end |
#to_s ⇒ Object
56 57 58 |
# File 'lib/client/link.rb', line 56 def to_s sprintf("Instamojo Link(slug: %s, title: %s, shorturl: %s, status: %s)", slug, title, shorturl, status) end |