class RakutenWebService::Recipe::Category

Public Instance Methods

absolute_category_id() click to toggle source
# File lib/rakuten_web_service/recipe/category.rb, line 45
def absolute_category_id
  if parent_category
    [parent_category.absolute_category_id, id.to_s].join('-')
  else
    id.to_s
  end
end
parent_category() click to toggle source
# File lib/rakuten_web_service/recipe/category.rb, line 38
def parent_category
  return nil if parent_category_type.nil?
  Recipe.categories(parent_category_type).find do |c|
    c.id.to_i == parent_category_id.to_i
  end
end
ranking() click to toggle source
# File lib/rakuten_web_service/recipe/category.rb, line 34
def ranking
  Recipe.ranking(absolute_category_id)
end

Private Instance Methods

parent_category_type() click to toggle source
# File lib/rakuten_web_service/recipe/category.rb, line 55
def parent_category_type
  case type
  when 'small' then 'medium'
  when 'medium' then 'large'
  end
end