Class: LongTweet::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/long_tweet/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(agent) ⇒ Config

Returns a new instance of Config.



6
7
8
9
# File 'lib/long_tweet/config.rb', line 6

def initialize agent
  @agent = agent
  @store = GeneralStore.read('~/.long_tweet')
end

Instance Attribute Details

#agentObject (readonly)

Returns the value of attribute agent.



5
6
7
# File 'lib/long_tweet/config.rb', line 5

def agent
  @agent
end

#storeObject (readonly)

Returns the value of attribute store.



5
6
7
# File 'lib/long_tweet/config.rb', line 5

def store
  @store
end

Instance Method Details

#configureObject



11
12
13
14
15
16
17
18
# File 'lib/long_tweet/config.rb', line 11

def configure
  agent.configure do |config|
    config.consumer_key = store.consumer_key
    config.consumer_secret = store.consumer_secret
    config.oauth_token = store.oauth_token
    config.oauth_token_secret = store.oauth_token_secret
  end
end