Class: ServiceDouble::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



11
12
13
14
15
16
17
# File 'lib/service_double/configuration.rb', line 11

def initialize
  @url = nil
  @server = nil
  @log_file = nil
  @timeout = 5
  @disable_bundler = true
end

Instance Attribute Details

#disable_bundlerObject

Returns the value of attribute disable_bundler.



9
10
11
# File 'lib/service_double/configuration.rb', line 9

def disable_bundler
  @disable_bundler
end

#log_fileObject

Returns the value of attribute log_file.



9
10
11
# File 'lib/service_double/configuration.rb', line 9

def log_file
  @log_file
end

#serverObject

Returns the value of attribute server.



9
10
11
# File 'lib/service_double/configuration.rb', line 9

def server
  @server
end

#timeoutObject

Returns the value of attribute timeout.



9
10
11
# File 'lib/service_double/configuration.rb', line 9

def timeout
  @timeout
end

#urlObject

Returns the value of attribute url.



9
10
11
# File 'lib/service_double/configuration.rb', line 9

def url
  @url
end

Instance Method Details

#nameObject



40
41
42
# File 'lib/service_double/configuration.rb', line 40

def name
  File.basename(server, ".rb")
end

#no_server_set!Object

Raises:



48
49
50
# File 'lib/service_double/configuration.rb', line 48

def no_server_set!
  raise NoServerSet, "No server option set."
end

#no_url_set!Object

Raises:



44
45
46
# File 'lib/service_double/configuration.rb', line 44

def no_url_set!
  raise NoURLSet, "No URL set for the fake shop."
end