Class: RakutenWebService::Recipe::Category
Instance Method Summary
collapse
#==, #[], all, attribute, client, endpoint, #get_attribute, #initialize, resource_name, search, set_parser, set_resource_name
Instance Method Details
#absolute_category_id ⇒ Object
41
42
43
44
45
46
47
|
# File 'lib/rakuten_web_service/recipe/category.rb', line 41
def absolute_category_id
if parent_category
[parent_category.absolute_category_id, id.to_s].join('-')
else
id.to_s
end
end
|
#parent_category ⇒ Object
36
37
38
39
|
# File 'lib/rakuten_web_service/recipe/category.rb', line 36
def parent_category
return nil if parent_category_type.nil?
Recipe.categories(parent_category_type).find { |c| c.id.to_i === parent_category_id.to_i }
end
|
#ranking ⇒ Object
32
33
34
|
# File 'lib/rakuten_web_service/recipe/category.rb', line 32
def ranking
Recipe.ranking(absolute_category_id)
end
|