Class: Puzzle::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/puzzle/configuration.rb

Overview

Class used to store configuration information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_fileString

Returns The path to the certificate.

Returns:

  • (String)

    The path to the certificate



20
21
22
# File 'lib/puzzle/configuration.rb', line 20

def ca_file
  @ca_file
end

#ca_pathString

Returns The path to the certificate.

Returns:

  • (String)

    The path to the certificate



17
18
19
# File 'lib/puzzle/configuration.rb', line 17

def ca_path
  @ca_path
end

#formatString

Returns The return format (XML/JSON).

Returns:

  • (String)

    The return format (XML/JSON)



11
12
13
# File 'lib/puzzle/configuration.rb', line 11

def format
  @format
end

#hostString

Returns The host to connect to (defaults to api.openbeerdatabase.com).

Returns:

  • (String)

    The host to connect to (defaults to api.openbeerdatabase.com).



5
6
7
# File 'lib/puzzle/configuration.rb', line 5

def host
  @host
end

#portInteger

Returns The port used to communicate.

Returns:

  • (Integer)

    The port used to communicate



8
9
10
# File 'lib/puzzle/configuration.rb', line 8

def port
  @port
end

#tokenString

Returns The API token for your user.

Returns:

  • (String)

    The API token for your user.



14
15
16
# File 'lib/puzzle/configuration.rb', line 14

def token
  @token
end

#verify_modeString

Returns The verification method used by ssl.

Returns:

  • (String)

    The verification method used by ssl



23
24
25
# File 'lib/puzzle/configuration.rb', line 23

def verify_mode
  @verify_mode
end