Class: LastTweetRedux::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/last_tweet_redux/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#intervalObject

Returns the value of attribute interval.



9
10
11
# File 'lib/last_tweet_redux/configuration.rb', line 9

def interval
  @interval
end

#oauth_credentialsObject

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_urlObject

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_nameObject

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