class Flavordb::Product
Attributes
business_id[R]
product_category_id[R]
Public Class Methods
new(data)
click to toggle source
Calls superclass method
Flavordb::Base::new
# File lib/flavordb/product.rb, line 24 def initialize data super @product_category_id = data['productCategoryId'] @business_id = data['businessId'] @business_resource = data['business'] ? data['business']['resource'] : nil @product_category_resource = data['productCategory'] ? data['productCategory']['resource'] : nil end
object_cache()
click to toggle source
# File lib/flavordb/product.rb, line 7 def object_cache @object_cache = {} if @object_cache.nil? @object_cache end
Public Instance Methods
business(opts={})
click to toggle source
# File lib/flavordb/product.rb, line 13 def business(opts={}) client = opts[:client] || Flavordb::Client.default_client client.get_business(business_id) end
product_category(opts={})
click to toggle source
# File lib/flavordb/product.rb, line 18 def product_category(opts={}) client = opts[:client] || Flavordb::Client.default_client client.get_product_category(product_category_id) end