Class: Weeter::Configuration::TwitterConfig

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/weeter/configuration/twitter_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#basic_authObject

Returns the value of attribute basic_auth.



7
8
9
# File 'lib/weeter/configuration/twitter_config.rb', line 7

def basic_auth
  @basic_auth
end

#oauthObject

Returns the value of attribute oauth.



7
8
9
# File 'lib/weeter/configuration/twitter_config.rb', line 7

def oauth
  @oauth
end

Instance Method Details

#auth_optionsObject



9
10
11
12
13
14
15
16
17
# File 'lib/weeter/configuration/twitter_config.rb', line 9

def auth_options
  if oauth
    {:oauth => oauth}
  else
    username = basic_auth[:username]
    password = basic_auth[:password]
    {:auth => "#{username}:#{password}"}
  end
end