Class: Squall::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/squall/support/config.rb

Overview

Holds the configuration for Squall

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Config) initialize

Returns a new instance of Config



7
8
9
# File 'lib/squall/support/config.rb', line 7

def initialize
  @config = {}
end

Instance Attribute Details

- (Object) config

A Hash that stores configuration info.



5
6
7
# File 'lib/squall/support/config.rb', line 5

def config
  @config
end

Instance Method Details

- (Object) [](v)

Hash accessor, delegates to `@config`.

Returns:

  • the value from `@config`.



14
15
16
# File 'lib/squall/support/config.rb', line 14

def [](v)
  @config[v]
end

- (Object) base_uri(value)

Sets the URL of your OnApp instance.

Parameters:

  • value

    The String URL

Returns:

  • value.



23
24
25
# File 'lib/squall/support/config.rb', line 23

def base_uri(value)
  @config[:base_uri] = value
end

- (Object) debug(value)

Set to true to enable HTTP logging.

Parameters:

  • value

    A Boolean

Returns:

  • value.



50
51
52
# File 'lib/squall/support/config.rb', line 50

def debug(value)
  @config[:debug] = value
end

- (Object) password(value)

Sets the API Password>

Parameters:

  • value

    The String password

Returns:

  • value.



41
42
43
# File 'lib/squall/support/config.rb', line 41

def password(value)
  @config[:password] = value
end

- (Object) username(value)

Sets the API username.

Parameters:

  • value

    The String username

Returns:

  • value.



32
33
34
# File 'lib/squall/support/config.rb', line 32

def username(value)
  @config[:username] = value
end