Sha256: 0f546870ae96ec7b7bcd4e601039b822dbe42113e341678092c2fcdc7eb7b3df

Contents?: true

Size: 1.39 KB

Versions: 6

Compression:

Stored size: 1.39 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

        def genre_class
          RakutenWebService::Ichiba::Genre
        end
      end

      endpoint 'https://app.rakuten.co.jp/services/api/IchibaItem/Search/20140222'

      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, :shopAffiliateUrl,
        :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,
          'shopAffiliateUrl' => self.shop_affiliate_url
        })
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rakuten_web_service-1.5.0 lib/rakuten_web_service/ichiba/item.rb
rakuten_web_service-1.4.2 lib/rakuten_web_service/ichiba/item.rb
rakuten_web_service-1.4.1 lib/rakuten_web_service/ichiba/item.rb
rakuten_web_service-1.4.0 lib/rakuten_web_service/ichiba/item.rb
rakuten_web_service-1.3.0 lib/rakuten_web_service/ichiba/item.rb
rakuten_web_service-1.2.0 lib/rakuten_web_service/ichiba/item.rb