Sha256: 66aeddade06112581c8be1633d7f6a9fffd027b02a3acb4321949a354dc00917

Contents?: true

Size: 725 Bytes

Versions: 4

Compression:

Stored size: 725 Bytes

Contents

# encoding: utf-8

require 'rakuten_web_service/resource'

module RakutenWebService
  module Kobo
    class Ebook < RakutenWebService::Resource
      endpoint 'https://app.rakuten.co.jp/services/api/Kobo/EbookSearch/20131010'

      attribute :title, :titleKana, :subTitle,
        :author, :authorKana, :publisherName,
        :itemNumber, :itemCaption,
        :salesDate, :itemPrice,
        :itemUrl, :affiliateUrl,
        :smallImageUrl, :mediumImageUrl, :largeImageUrl,
        :reviewCount, :reviewAverage,
        :koboGenreId

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

      def genre
        Kobo::Genre.new(self.kobo_genre_id)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rakuten_web_service-0.6.3 lib/rakuten_web_service/kobo/ebook.rb
rakuten_web_service-0.6.2 lib/rakuten_web_service/kobo/ebook.rb
rakuten_web_service-0.6.1 lib/rakuten_web_service/kobo/ebook.rb
rakuten_web_service-0.6.0 lib/rakuten_web_service/kobo/ebook.rb