Class: Puzzle::Configuration
- Inherits:
-
Object
- Object
- Puzzle::Configuration
- Defined in:
- lib/puzzle/configuration.rb
Overview
Class used to store configuration information
Instance Attribute Summary collapse
-
#ca_file ⇒ String
The path to the certificate.
-
#ca_path ⇒ String
The path to the certificate.
-
#format ⇒ String
The return format (XML/JSON).
-
#host ⇒ String
The host to connect to (defaults to
api.openbeerdatabase.com
). -
#port ⇒ Integer
The port used to communicate.
-
#token ⇒ String
The API token for your user.
-
#verify_mode ⇒ String
The verification method used by ssl.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Instantiated from configuration.
Constructor Details
#initialize ⇒ Configuration
Instantiated from Puzzle.configuration. Sets defaults.
26 27 28 29 30 31 32 33 |
# File 'lib/puzzle/configuration.rb', line 26 def initialize self.host = "www.jigsaw.com" self.port = 443 self.format = "json" self.verify_mode = OpenSSL::SSL::VERIFY_PEER self.ca_path = '/etc/ssl/certs' if File.exists?('/etc/ssl/certs') # Ubuntu self.ca_file = '/opt/local/share/curl/curl-ca-bundle.crt' if File.exists?('/opt/local/share/curl/curl-ca-bundle.crt') # Mac OS X end |
Instance Attribute Details
#ca_file ⇒ String
Returns The path to the certificate.
20 21 22 |
# File 'lib/puzzle/configuration.rb', line 20 def ca_file @ca_file end |
#ca_path ⇒ String
Returns The path to the certificate.
17 18 19 |
# File 'lib/puzzle/configuration.rb', line 17 def ca_path @ca_path end |
#format ⇒ String
Returns The return format (XML/JSON).
11 12 13 |
# File 'lib/puzzle/configuration.rb', line 11 def format @format end |
#host ⇒ String
Returns The host to connect to (defaults to api.openbeerdatabase.com
).
5 6 7 |
# File 'lib/puzzle/configuration.rb', line 5 def host @host end |
#port ⇒ Integer
Returns The port used to communicate.
8 9 10 |
# File 'lib/puzzle/configuration.rb', line 8 def port @port end |
#token ⇒ String
Returns The API token for your user.
14 15 16 |
# File 'lib/puzzle/configuration.rb', line 14 def token @token end |
#verify_mode ⇒ String
Returns The verification method used by ssl.
23 24 25 |
# File 'lib/puzzle/configuration.rb', line 23 def verify_mode @verify_mode end |