Class: Rubyku::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyku/settings.rb

Overview

This class acts as a centralized location for configurable items in rubyku. The configurable properties are as follows:

  • logger: a ruby logger object where all messages are logged.

  • jaiku_credentials: an instance of Rubyku::Credentials that is used

    throughout rubyku as the default credentials.
    
  • proxy_url: the url for an http proxy, if needed.

  • proxy_port: the port for an http proxy, if needed.

The logger, by default, will log at Logger::INFO to STDOUT. If you would like to integrate the rubyku logging statements into your own logs, simply replace the logger with your own at some point after including rubyku in your project. WARNING: a logger set to Logger::DEBUG will spit all kinds of user-sensitive information, and as such should only be used for testing.

Class Attribute Summary collapse

Class Attribute Details

.jaiku_credentialsObject

Anywhere a rubyku method needs credentials, it will default to this property. You shouldn’t use this property if you are writing a multi-user app. If you’re writing a single user app, however, setting the credentials here lets you set-and-forget.



28
29
30
# File 'lib/rubyku/settings.rb', line 28

def jaiku_credentials
  @jaiku_credentials
end

.loggerObject

Yay logger! Default logger is initialized below. Override it if you want to use your own logger.



21
22
23
# File 'lib/rubyku/settings.rb', line 21

def logger
  @logger
end

.proxy_portObject

Returns the value of attribute proxy_port.



33
34
35
# File 'lib/rubyku/settings.rb', line 33

def proxy_port
  @proxy_port
end

.proxy_urlObject

Proxy settings. If these are nil, net/http just ignores it. So set these to nil if you don’t need a proxy.



32
33
34
# File 'lib/rubyku/settings.rb', line 32

def proxy_url
  @proxy_url
end