Class: Bidi2pdfRails::TestHelpers::Configuration

Inherits:
Bidi2pdf::TestHelpers::Configuration
  • Object
show all
Defined in:
lib/bidi2pdf_rails/test_helpers/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



30
31
32
33
34
35
36
37
# File 'lib/bidi2pdf_rails/test_helpers/configuration.rb', line 30

def initialize
  super
  @run_server = true
  @server_host = "localhost"
  @request_host = "localhost"
  @server_port = nil
  @server_boot_timeout = 15
end

Instance Attribute Details

#request_hostObject



39
40
41
# File 'lib/bidi2pdf_rails/test_helpers/configuration.rb', line 39

def request_host
  @request_host.respond_to?(:call) ? @request_host.call : @request_host
end

#run_serverBoolean

Returns whether to run the server during tests.

Returns:

  • (Boolean)

    whether to run the server during tests



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

def run_server
  @run_server
end

#serverObject

Returns the value of attribute server.



28
29
30
# File 'lib/bidi2pdf_rails/test_helpers/configuration.rb', line 28

def server
  @server
end

#server (for internal use only)Object?

Returns the server instance (nil if not set).

Returns:

  • (Object, nil)

    the server instance (nil if not set)



28
# File 'lib/bidi2pdf_rails/test_helpers/configuration.rb', line 28

attr_accessor :server

#server_boot_timeoutInteger

Returns the timeout in seconds for server boot.

Returns:

  • (Integer)

    the timeout in seconds for server boot



24
25
26
# File 'lib/bidi2pdf_rails/test_helpers/configuration.rb', line 24

def server_boot_timeout
  @server_boot_timeout
end

#server_hostString

Returns the host address for the server.

Returns:

  • (String)

    the host address for the server



12
13
14
# File 'lib/bidi2pdf_rails/test_helpers/configuration.rb', line 12

def server_host
  @server_host
end

#server_portInteger?

Returns the port for the server (nil if not set => random port).

Returns:

  • (Integer, nil)

    the port for the server (nil if not set => random port)



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

def server_port
  @server_port
end