Sha256: 19070a3d014598afaa4c9df6a867e5ec802d6dc94396c8fb7f5a080aa752f985

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 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/20170426'

      set_parser do |response|
        (response['Products'] || []).map { |prod| Product.new(prod) }
      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

1 entries across 1 versions & 1 rubygems

Version Path
rakuten_web_service-1.9.0 lib/rakuten_web_service/ichiba/product.rb