Module: Flattr::Client::Categories
- Included in:
- Flattr::Client
- Defined in:
- lib/flattr/client/categories.rb
Instance Method Summary collapse
-
#categories ⇒ Object
Public: Get a list of available categories.
-
#category(id) ⇒ Object
Public: Get a category by id.
Instance Method Details
#categories ⇒ Object
16 17 18 19 20 |
# File 'lib/flattr/client/categories.rb', line 16 def categories @categories ||= get('/rest/v2/categories').map do |category| Flattr::Category.new(category) end end |
#category(id) ⇒ Object
33 34 35 36 37 |
# File 'lib/flattr/client/categories.rb', line 33 def category(id) categories.select do |category| category.id == id end.first end |