Class: LastTweetRedux::Configuration
- Inherits:
-
Object
- Object
- LastTweetRedux::Configuration
- Defined in:
- lib/last_tweet_redux/configuration.rb
Instance Attribute Summary collapse
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#oauth_credentials ⇒ Object
Returns the value of attribute oauth_credentials.
-
#redis_url ⇒ Object
Returns the value of attribute redis_url.
-
#screen_name ⇒ Object
Returns the value of attribute screen_name.
Instance Method Summary collapse
-
#initialize(config_path) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(config_path) ⇒ Configuration
11 12 13 14 15 16 17 18 |
# File 'lib/last_tweet_redux/configuration.rb', line 11 def initialize(config_path) credentials = YAML.load_file(config_path).symbolize_keys self.oauth_credentials = credentials.fetch(:oauth).symbolize_keys self.screen_name = credentials.fetch(:screen_name) self.redis_url = credentials.fetch(:redis_url) self.interval = credentials.fetch(:interval).to_i.minutes end |
Instance Attribute Details
#interval ⇒ Object
Returns the value of attribute interval.
9 10 11 |
# File 'lib/last_tweet_redux/configuration.rb', line 9 def interval @interval end |
#oauth_credentials ⇒ Object
Returns the value of attribute oauth_credentials.
8 9 10 |
# File 'lib/last_tweet_redux/configuration.rb', line 8 def oauth_credentials @oauth_credentials end |
#redis_url ⇒ Object
Returns the value of attribute redis_url.
7 8 9 |
# File 'lib/last_tweet_redux/configuration.rb', line 7 def redis_url @redis_url end |
#screen_name ⇒ Object
Returns the value of attribute screen_name.
6 7 8 |
# File 'lib/last_tweet_redux/configuration.rb', line 6 def screen_name @screen_name end |