Sha256: 20390ca4daa357c002f918ac5984a4a5f81a8db832d54f3e547dd91f591a00ce

Contents?: true

Size: 372 Bytes

Versions: 2

Compression:

Stored size: 372 Bytes

Contents

require 'flattr/category'

module Flattr
  class Client
    module Categories

      def categories
        @categories ||= get('/rest/v2/categories').map do |category|
          Flattr::Category.new(category)
        end
      end

      def category(id)
        categories.select do |category|
          category.id == id
        end.first
      end


    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flattr-0.2.2 lib/flattr/client/categories.rb
flattr-0.2.1 lib/flattr/client/categories.rb