Sha256: 68cb10b48567a3dc8a68f73b98cdcf3fe5a849b72a5712ac626a2e3c1f4e1c79

Contents?: true

Size: 788 Bytes

Versions: 4

Compression:

Stored size: 788 Bytes

Contents

require 'rakuten_web_service/resource'

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

      attribute :title, :titleKana, :subTitle, :seriesName,
        :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) }
      end

      def self.genre_class
        RakutenWebService::Kobo::Genre
      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-1.8.0 lib/rakuten_web_service/kobo/ebook.rb
rakuten_web_service-1.7.0 lib/rakuten_web_service/kobo/ebook.rb
rakuten_web_service-1.6.1 lib/rakuten_web_service/kobo/ebook.rb
rakuten_web_service-1.6.0 lib/rakuten_web_service/kobo/ebook.rb