Sha256: e6bdae41cedc4d859dc5cb1d03b969510397a36c6d118c455288025463709691

Contents?: true

Size: 1.21 KB

Versions: 17

Compression:

Stored size: 1.21 KB

Contents

require 'rakuten_web_service/resource'
require 'rakuten_web_service/ichiba/genre'

module RakutenWebService
  module Ichiba
    class Product < Resource
      endpoint 'https://app.rakuten.co.jp/services/api/Product/Search/20140305'

      set_parser do |response|
        (response['Products'] || []).map { |prod| Product.new(prod['Product']) }
      end

      attribute :productId, :productName, :productNo, :brandName,
        :productUrlPC, :productUrlMobile, :affiliateUrl,
        :smallImageUrl, :mediumImageUrl,
        :productCaption, :releaseDate,
        :makerCode, :makerName, :makerNameKana, :makerNameFormal,
        :makerPageUrlPC, :makerPageUrlMobile,
        :itemCount, :salesItemCount,
        :usedExcludeCount, :usedExcludeSalesItemCount,
        :maxPrice, :salesMaxPrice, :usedExcludeMaxPrice, :usedExcludeSalesMaxPrice,
        :minPrice, :salesMinPrice, :usedExcludeMinPrice, :usedExcludeSalesMinPrice,
        :averagePrice,
        :reviewCount, :reviewAverage, :reviewUrlPC, :reviewUrlMobile,
        :rankTargetGenreId, :rankTargetProductCount,
        :genreId, :genreName,
        :ProductDetails

      def genre
        RakutenWebService::Ichiba::Genre.new(self.genre_id)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rakuten_web_service-1.5.0 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-1.4.2 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-1.4.1 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-1.4.0 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-1.3.0 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-1.2.0 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-1.1.1 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-1.1.0 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-1.0.0 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-1.0.0.rc1 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-0.6.3 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-0.6.2 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-0.6.1 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-0.6.0 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-0.5.0 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-0.4.2 lib/rakuten_web_service/ichiba/product.rb
rakuten_web_service-0.4.1 lib/rakuten_web_service/ichiba/product.rb