Sha256: a622c27971f12769216818406443914b0df688acedd56fc305513fe13f0e2bd6

Contents?: true

Size: 796 Bytes

Versions: 6

Compression:

Stored size: 796 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['Item']) }
      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

6 entries across 6 versions & 1 rubygems

Version Path
rakuten_web_service-1.5.0 lib/rakuten_web_service/kobo/ebook.rb
rakuten_web_service-1.4.2 lib/rakuten_web_service/kobo/ebook.rb
rakuten_web_service-1.4.1 lib/rakuten_web_service/kobo/ebook.rb
rakuten_web_service-1.4.0 lib/rakuten_web_service/kobo/ebook.rb
rakuten_web_service-1.3.0 lib/rakuten_web_service/kobo/ebook.rb
rakuten_web_service-1.2.0 lib/rakuten_web_service/kobo/ebook.rb