Module: Delicious::Tags::Methods::All

Extended by:
ActiveSupport::Concern
Included in:
Api
Defined in:
lib/delicious/tags/methods/all.rb

Instance Method Summary collapse

Instance Method Details

#allArray<Tag>

Get all tags

Returns:

  • (Array<Tag>)

    List of tags



13
14
15
16
17
18
19
# File 'lib/delicious/tags/methods/all.rb', line 13

def all
  response = @client.connection.get '/v1/tags/get'
  fail Delicious::Error, 'Error getting tags' unless response.body['tags']
  response.body['tags']['tag'].map do |attrs|
    Tag.build_persisted @client, name: attrs['tag'], count: attrs['count'].to_i
  end
end