Class: Zype::Plans

Inherits:
BaseModel show all
Defined in:
lib/zype/models/plans.rb

Overview

Since:

  • 0.16.0

Constant Summary

Constants inherited from BaseModel

BaseModel::ACCEPTED_KEYS

Instance Attribute Summary

Attributes inherited from BaseModel

#client, #path

Instance Method Summary collapse

Methods inherited from BaseModel

#all, #auth=, #create, #delete, #find, #initialize, #update

Constructor Details

This class inherits a constructor from Zype::BaseModel

Instance Method Details

#add_playlists(id:, params:) ⇒ Object

Only for tiered subscription plans. Read more here docs.zype.com/v1.0/reference#addplaylists-1

return [Hash]

Parameters:

  • id (String)

    ID of the plan

  • params (Hash)

    should be a hash with playlist_ids as a key

Since:

  • 0.16.0



12
13
14
# File 'lib/zype/models/plans.rb', line 12

def add_playlists(id:, params:)
  client.execute(method: :put, path: "/#{path}/#{id}/add_playlists", params: params)
end

#remove_playlists(id:, params:) ⇒ Object

This will remove playlists from the specified plan

return [Hash]

Parameters:

  • id (String)

    ID of the plan

  • params (Hash)

    should be a hash with playlist_ids as a key

Since:

  • 0.16.0



21
22
23
# File 'lib/zype/models/plans.rb', line 21

def remove_playlists(id:, params:)
  client.execute(method: :put, path: "/#{path}/#{id}/remove_playlists", params: params)
end