Class: TiendaNube::ProductVariant

Inherits:
Resource::Base show all
Defined in:
lib/tienda_nube/resource.rb

Class Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Resource::Base

all, create, delete, from_url, get, update

Class Attribute Details

.product_idObject

Returns the value of attribute product_id.



108
109
110
# File 'lib/tienda_nube/resource.rb', line 108

def product_id
  @product_id
end

Class Method Details

.nameObject



110
111
112
# File 'lib/tienda_nube/resource.rb', line 110

def name
  "products/#{self.product_id}/variants"
end

.url(id = nil) ⇒ Object



114
115
116
117
118
# File 'lib/tienda_nube/resource.rb', line 114

def self.url(id = nil)
  url = "#{Resource.base_url}/products/#{self.product_id}/#{self.name}"
  url = "#{url}/#{id}" if id
  return url
end