Module: Bitly::Config
- Defined in:
- lib/providers/bitly/config.rb
Class Attribute Summary collapse
-
.api_key ⇒ Object
Returns the value of attribute api_key.
-
.config_file ⇒ Object
Returns the value of attribute config_file.
-
.login ⇒ Object
Returns the value of attribute login.
Class Method Summary collapse
Class Attribute Details
.api_key ⇒ Object
Returns the value of attribute api_key.
5 6 7 |
# File 'lib/providers/bitly/config.rb', line 5 def api_key @api_key end |
.config_file ⇒ Object
Returns the value of attribute config_file.
5 6 7 |
# File 'lib/providers/bitly/config.rb', line 5 def config_file @config_file end |
.login ⇒ Object
Returns the value of attribute login.
5 6 7 |
# File 'lib/providers/bitly/config.rb', line 5 def login @login end |
Class Method Details
.load_config ⇒ Object
12 13 14 15 16 17 |
# File 'lib/providers/bitly/config.rb', line 12 def load_config() unless config_file.nil? api_details = YAML.load(File.open(config_file)).symbolize_keys @api_key, @login = api_details[:api_key], api_details[:login] end end |
.set(&block) ⇒ Object
7 8 9 10 |
# File 'lib/providers/bitly/config.rb', line 7 def set(&block) self.class_eval(&block) if block_given? load_config end |