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.



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

def initialize
  self.host = "www.jigsaw.com"
  self.port = 443
  self.format = "json"
end

Instance Attribute Details

#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