Sha256: 8d5eff0821a5ea03ef8d52d3cc0719e413c907d8abc7330cdc1c6cb3b2731ae3

Contents?: true

Size: 1.24 KB

Versions: 9

Compression:

Stored size: 1.24 KB

Contents

require 'rakuten_web_service/resource'

module RakutenWebService
  module Ichiba
    class Item < Resource
      class << self
        def ranking(options={})
          RakutenWebService::Ichiba::RankingItem.search(options)
        end
      end
      
      endpoint 'https://app.rakuten.co.jp/services/api/IchibaItem/Search/20130805'

      set_parser do |response|
        response['Items'].map { |item| Item.new(item['Item']) }
      end

      attribute :itemName, :catchcopy, :itemCode, :itemPrice,
        :itemCaption, :itemUrl, :affiliateUrl, :imageFlag,
        :smallImageUrls, :mediumImageUrls,
        :availability, :taxFlag, 
        :postageFlag, :creditCardFlag,
        :shopOfTheYearFlag,
        :shipOverseasFlag, :shipOverseasArea,
        :asurakuFlag, :asurakuClosingTime, :asurakuArea,
        :affiliateRate,
        :startTime, :endTime,
        :reviewCount, :reviewAverage,
        :pointRate, :pointRateStartTime, :pointRateEndTime,
        :shopName, :shopCode, :shopUrl,
        :genreId

      def genre
        Genre.new(self.genre_id)
      end

      def shop
        Shop.new({
          'shopName' => self.shop_name,
          'shopCode' => self.shop_code,
          'shopUrl' => self.shop_url
        })
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rakuten_web_service-0.6.3 lib/rakuten_web_service/ichiba/item.rb
rakuten_web_service-0.6.2 lib/rakuten_web_service/ichiba/item.rb
rakuten_web_service-0.6.1 lib/rakuten_web_service/ichiba/item.rb
rakuten_web_service-0.6.0 lib/rakuten_web_service/ichiba/item.rb
rakuten_web_service-0.5.0 lib/rakuten_web_service/ichiba/item.rb
rakuten_web_service-0.4.2 lib/rakuten_web_service/ichiba/item.rb
rakuten_web_service-0.4.1 lib/rakuten_web_service/ichiba/item.rb
rakuten_web_service-0.3.1 lib/rakuten_web_service/ichiba/item.rb
rakuten_web_service-0.3.0 lib/rakuten_web_service/ichiba/item.rb