Class: PackageCloud::MasterToken

Inherits:
Object
  • Object
show all
Defined in:
lib/package_cloud/master_token.rb

Instance Method Summary collapse

Methods inherited from Object

#method_missing, #respond_to?

Constructor Details

#initialize(attrs, config) ⇒ MasterToken

Returns a new instance of MasterToken.



3
4
5
6
# File 'lib/package_cloud/master_token.rb', line 3

def initialize(attrs, config)
  @attrs = attrs
  @config = config
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PackageCloud::Object

Instance Method Details

#destroyObject



14
15
16
17
# File 'lib/package_cloud/master_token.rb', line 14

def destroy
  url = PackageCloud::Util.compute_url(@config.base_url, paths["self"])
  RestClient.delete(url)
end

#read_tokensObject



8
9
10
11
12
# File 'lib/package_cloud/master_token.rb', line 8

def read_tokens
  @attrs["read_tokens"].map do |read_token|
    ReadToken.new(@config, read_token)
  end
end