Class: Trinidad::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Configuration

Returns a new instance of Configuration.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/trinidad/configuration.rb', line 23

def initialize(options = {})
  @environment = 'development'
  @context_path = '/'
  @libs_dir = 'lib'
  @classes_dir = 'classes'
  @default_web_xml = 'config/web.xml'
  @port = 3000
  @jruby_min_runtimes = 1
  @jruby_max_runtimes = 5
  @address = 'localhost'
  @log = 'INFO'
  @trap = true

  options.symbolize!.each {|k, v| self[k] = v}
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def address
  @address
end

#ajpObject

Returns the value of attribute ajp.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def ajp
  @ajp
end

#apps_baseObject

Returns the value of attribute apps_base.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def apps_base
  @apps_base
end

#classes_dirObject

Returns the value of attribute classes_dir.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def classes_dir
  @classes_dir
end

#context_pathObject

Returns the value of attribute context_path.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def context_path
  @context_path
end

#default_web_xmlObject

Returns the value of attribute default_web_xml.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def default_web_xml
  @default_web_xml
end

#environmentObject

Returns the value of attribute environment.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def environment
  @environment
end

#extensionsObject

Returns the value of attribute extensions.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def extensions
  @extensions
end

#hostsObject

Returns the value of attribute hosts.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def hosts
  @hosts
end

#httpObject

Returns the value of attribute http.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def http
  @http
end

#jruby_max_runtimesObject

Returns the value of attribute jruby_max_runtimes.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def jruby_max_runtimes
  @jruby_max_runtimes
end

#jruby_min_runtimesObject

Returns the value of attribute jruby_min_runtimes.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def jruby_min_runtimes
  @jruby_min_runtimes
end

#libs_dirObject

Returns the value of attribute libs_dir.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def libs_dir
  @libs_dir
end

#logObject

Returns the value of attribute log.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def log
  @log
end

#monitorObject

Returns the value of attribute monitor.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def monitor
  @monitor
end

#portObject

Returns the value of attribute port.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def port
  @port
end

#publicObject

Returns the value of attribute public.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def public
  @public
end

#rackupObject

Returns the value of attribute rackup.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def rackup
  @rackup
end

#servletObject

Returns the value of attribute servlet.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def servlet
  @servlet
end

#sslObject

Returns the value of attribute ssl.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def ssl
  @ssl
end

#trapObject

Returns the value of attribute trap.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def trap
  @trap
end

#web_app_dirObject

Returns the value of attribute web_app_dir.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def web_app_dir
  @web_app_dir
end

#web_appsObject

Returns the value of attribute web_apps.



18
19
20
# File 'lib/trinidad/configuration.rb', line 18

def web_apps
  @web_apps
end

Instance Method Details

#[](name) ⇒ Object



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

def [](name)
  respond_to?(name) ? send(name) : nil
end

#[]=(name, value) ⇒ Object



43
44
45
# File 'lib/trinidad/configuration.rb', line 43

def []=(name, value)
  send :"#{name}=", value if respond_to?(:"#{name}=")
end

#has_key?(name) ⇒ Boolean Also known as: key?

Returns:

  • (Boolean)


47
48
49
# File 'lib/trinidad/configuration.rb', line 47

def has_key?(name)
  instance_variable_defined?(name) rescue false
end