Class: Quandl::Command::QConfig
- Inherits:
-
Object
- Object
- Quandl::Command::QConfig
- Defined in:
- lib/quandl/command/qconfig.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize(*args) ⇒ QConfig
constructor
A new instance of QConfig.
Constructor Details
#initialize(*args) ⇒ QConfig
Returns a new instance of QConfig.
61 62 63 |
# File 'lib/quandl/command/qconfig.rb', line 61 def initialize(*args) self. = OpenStruct.new(args.) end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
57 58 59 |
# File 'lib/quandl/command/qconfig.rb', line 57 def @options end |
Class Method Details
.config_file ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/quandl/command/qconfig.rb', line 15 def config_file return @config_file if defined?(@config_file) @config_file = File.join(root_path, 'config') convert_legacy_config ensure_directory_is_present @config_file end |
.configuration ⇒ Object
11 12 13 |
# File 'lib/quandl/command/qconfig.rb', line 11 def configuration @configuration ||= self.new( config_file: config_file ) end |
.root_path ⇒ Object
23 24 25 |
# File 'lib/quandl/command/qconfig.rb', line 23 def root_path @root_path ||= File.join(ENV['HOME'], '.quandl') end |
Instance Method Details
#config ⇒ Object
65 66 67 |
# File 'lib/quandl/command/qconfig.rb', line 65 def config @config ||= OpenStruct.new(YAML.load(File.read(.config_file))) end |