Sha256: 84be39dce5b665e7e12ab0665eccb021d6085e6d5c88461d0079384d6f541200

Contents?: true

Size: 711 Bytes

Versions: 9

Compression:

Stored size: 711 Bytes

Contents

require 'rakuten_web_service/configuration'

require 'rakuten_web_service/recipe/category'

module RakutenWebService
  class Recipe < Resource
    endpoint 'https://app.rakuten.co.jp/services/api/Recipe/CategoryRanking/20121121'

    attribute :recipeId, :recipeTitle, :recipeUrl,
      :foodImageUrl, :mediumImageUrl, :smallImageUrl,
      :pickup, :shop, :nickname,
      :recipeDescription, :recipeMaterial,
      :recipeIndication, :recipeCost,
      :recipePublishday, :rank

    set_parser do |response|
      response['result'].map { |r| Recipe.new(r) }
    end

    def self.ranking(category)
      self.search(category_id: category)
    end

    class << self
      protected :search
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rakuten_web_service-1.4.2 lib/rakuten_web_service/recipe.rb
rakuten_web_service-1.4.1 lib/rakuten_web_service/recipe.rb
rakuten_web_service-1.4.0 lib/rakuten_web_service/recipe.rb
rakuten_web_service-1.3.0 lib/rakuten_web_service/recipe.rb
rakuten_web_service-1.2.0 lib/rakuten_web_service/recipe.rb
rakuten_web_service-1.1.1 lib/rakuten_web_service/recipe.rb
rakuten_web_service-1.1.0 lib/rakuten_web_service/recipe.rb
rakuten_web_service-1.0.0 lib/rakuten_web_service/recipe.rb
rakuten_web_service-1.0.0.rc1 lib/rakuten_web_service/recipe.rb