Class: Bing::Content::Api::Product

Inherits:
Object
  • Object
show all
Defined in:
lib/bing/content/api/product.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#availabilityObject

Returns the value of attribute availability.



5
6
7
# File 'lib/bing/content/api/product.rb', line 5

def availability
  @availability
end

#channelObject

Returns the value of attribute channel.



5
6
7
# File 'lib/bing/content/api/product.rb', line 5

def channel
  @channel
end

#conditionObject

Returns the value of attribute condition.



5
6
7
# File 'lib/bing/content/api/product.rb', line 5

def condition
  @condition
end

#content_languageObject

Returns the value of attribute content_language.



5
6
7
# File 'lib/bing/content/api/product.rb', line 5

def content_language
  @content_language
end

#currencyObject

Returns the value of attribute currency.



5
6
7
# File 'lib/bing/content/api/product.rb', line 5

def currency
  @currency
end

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/bing/content/api/product.rb', line 5

def description
  @description
end

Returns the value of attribute image_link.



5
6
7
# File 'lib/bing/content/api/product.rb', line 5

def image_link
  @image_link
end

#offer_idObject

Returns the value of attribute offer_id.



5
6
7
# File 'lib/bing/content/api/product.rb', line 5

def offer_id
  @offer_id
end

#priceObject

Returns the value of attribute price.



5
6
7
# File 'lib/bing/content/api/product.rb', line 5

def price
  @price
end

#product_categoryObject

Returns the value of attribute product_category.



5
6
7
# File 'lib/bing/content/api/product.rb', line 5

def product_category
  @product_category
end

Returns the value of attribute product_link.



5
6
7
# File 'lib/bing/content/api/product.rb', line 5

def product_link
  @product_link
end

#product_typeObject

Returns the value of attribute product_type.



5
6
7
# File 'lib/bing/content/api/product.rb', line 5

def product_type
  @product_type
end

#target_countryObject

Returns the value of attribute target_country.



5
6
7
# File 'lib/bing/content/api/product.rb', line 5

def target_country
  @target_country
end

#titleObject

Returns the value of attribute title.



5
6
7
# File 'lib/bing/content/api/product.rb', line 5

def title
  @title
end

Instance Method Details

#bing_product_idObject



7
8
9
# File 'lib/bing/content/api/product.rb', line 7

def bing_product_id
  "#{@channel}:#{@content_language}:#{@target_country}:#{@offer_id}"
end

#to_recordObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/bing/content/api/product.rb', line 11

def to_record
  {
    "offerId" => @offer_id,
    "title" => @title,
    "description" => @description,
    "price" => { "currency" => @currency, "value" => @price },
    "imageLink" => @image_link,
    "link" => @product_link,
    "targetCountry" => @target_country,
    "contentLanguage" => @content_language,
    "availability" => @availability,
    "channel" => @channel,
    "condition" => @condition,
    "productType" => @product_type,
    "googleProductCategory" => @product_category,
  }
end