Sha256: a5faa530f3c3e5b589541d49bdfad946c8d2fc2147f98ef324f709bba3f3fc97

Contents?: true

Size: 404 Bytes

Versions: 3

Compression:

Stored size: 404 Bytes

Contents

require "singleton"

module Weeter
  class Configuration
    class TwitterConfig
      include Singleton
      attr_accessor :basic_auth, :oauth

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
weeter-0.9.2 lib/weeter/configuration/twitter_config.rb
weeter-0.9.1 lib/weeter/configuration/twitter_config.rb
weeter-0.9.0 lib/weeter/configuration/twitter_config.rb