Class: TheTvdb::Configuration
- Inherits:
-
Object
- Object
- TheTvdb::Configuration
- Includes:
- Singleton
- Defined in:
- lib/the_tvdb/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
Instance Method Summary collapse
- #data_path ⇒ Object
- #default_path ⇒ Object
- #dump_path ⇒ Object
- #episodes_path ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #zip_path ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 |
# File 'lib/the_tvdb/configuration.rb', line 7 def initialize @api_key = ENV['TVDBKEY'] end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/the_tvdb/configuration.rb', line 6 def api_key @api_key end |
Instance Method Details
#data_path ⇒ Object
25 26 27 |
# File 'lib/the_tvdb/configuration.rb', line 25 def data_path "#{dump_path}/data" end |
#default_path ⇒ Object
18 19 20 |
# File 'lib/the_tvdb/configuration.rb', line 18 def default_path 'tmp/the_tvdb/' end |
#dump_path ⇒ Object
11 12 13 14 15 16 |
# File 'lib/the_tvdb/configuration.rb', line 11 def dump_path @dump_path ||= default_path FileUtils.mkdir_p("#{@dump_path}/zipfiles") if !File.directory?("#{@dump_path}/zipfiles") FileUtils.mkdir_p("#{@dump_path}/data/episodes") if !File.directory?("#{@dump_path}/data/episodes") @dump_path end |
#episodes_path ⇒ Object
28 29 30 |
# File 'lib/the_tvdb/configuration.rb', line 28 def episodes_path "#{data_path}/episodes" end |
#zip_path ⇒ Object
22 23 24 |
# File 'lib/the_tvdb/configuration.rb', line 22 def zip_path "#{dump_path}/zipfiles" end |