Sha256: 98a89200bce7c69e2fda725597b6517e30f5fa879678191199f171487a105c86

Contents?: true

Size: 1.21 KB

Versions: 2

Compression:

Stored size: 1.21 KB

Contents

module RakutenWebService
  module Ichiba
    class Item < Resource
      class << self
        def parse_response(response)
          response['Items'].map { |item| Item.new(item['Item']) }
        end

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

      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

2 entries across 2 versions & 1 rubygems

Version Path
rakuten_web_service-0.2.3 lib/rakuten_web_service/ichiba/item.rb
rakuten_web_service-0.2.2 lib/rakuten_web_service/ichiba/item.rb