class Napster::Models::Follower

Followers model

Attributes

client[RW]

Public Class Methods

new(arg) click to toggle source
# File lib/napster/models/follower.rb, line 9
def initialize(arg)
  @client = arg[:client] if arg[:client]
end

Public Instance Methods

by?(guids) click to toggle source
# File lib/napster/models/follower.rb, line 26
def by?(guids)
  path = "/me/followers/#{guids.join(',')}"
  options = {
    headers: {
      Authorization: 'Bearer ' + @client.access_token,
      'Content-Type' => 'application/json',
      'Accept-Version' => '2.0.0'
    }
  }
  @client.get(path, options)['members']
end
members(params) click to toggle source
# File lib/napster/models/follower.rb, line 13
def members(params)
  options = {
    params: params,
    headers: {
      Authorization: 'Bearer ' + @client.access_token,
      'Content-Type' => 'application/json',
      'Accept-Version' => '2.0.0'
    }
  }
  response = @client.get('/me/followers', options)
  Member.collection(data: response['members'], client: @client)
end