Class: SpotifyExporter::AppConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/spotifyexporter/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, secret) ⇒ AppConfig

Returns a new instance of AppConfig.



19
20
21
22
# File 'lib/spotifyexporter/config.rb', line 19

def initialize(id, secret)
  @spotify_client_id = id
  @spotify_client_secret = secret
end

Instance Attribute Details

#spotify_client_idObject

Returns the value of attribute spotify_client_id.



17
18
19
# File 'lib/spotifyexporter/config.rb', line 17

def spotify_client_id
  @spotify_client_id
end

#spotify_client_secretObject

Returns the value of attribute spotify_client_secret.



17
18
19
# File 'lib/spotifyexporter/config.rb', line 17

def spotify_client_secret
  @spotify_client_secret
end

Class Method Details

.new_emptyObject



32
33
34
# File 'lib/spotifyexporter/config.rb', line 32

def self.new_empty
  new("", "")
end

Instance Method Details

#credentials?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/spotifyexporter/config.rb', line 28

def credentials?
  !@spotify_client_secret.nil? && !@spotify_client_id.nil?
end

#to_yamlObject



24
25
26
# File 'lib/spotifyexporter/config.rb', line 24

def to_yaml
  to_h.to_yaml
end