Class: JSTP::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/jstp/configuration.rb

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



5
6
7
8
9
10
11
12
# File 'lib/jstp/configuration.rb', line 5

def initialize
  @port = SymbolMatrix :inbound => 33333, :outbound => 33333
  @strategy = SymbolMatrix :inbound => :tcp, :outbound => :tcp
  @logger = Logger.new $stdout
  @hostname = (`hostname`)[0..-2]
  @environment = :development
  @gateway = SymbolMatrix :reverse => true, :forward => true, :local => true
end

Instance Method Details

#environment(argument = nil) ⇒ Object



59
60
61
62
# File 'lib/jstp/configuration.rb', line 59

def environment argument = nil
  @environment = argument unless argument.nil?
  @environment
end

#environment=(argument) ⇒ Object



64
65
66
# File 'lib/jstp/configuration.rb', line 64

def environment= argument
  environment argument
end

#gateway(argument = nil) ⇒ Object



50
51
52
53
# File 'lib/jstp/configuration.rb', line 50

def gateway argument = nil
  @gateway = SymbolMatrix argument unless argument.nil?
  @gateway
end

#gateway=(argument) ⇒ Object



55
56
57
# File 'lib/jstp/configuration.rb', line 55

def gateway= argument
  gateway argument
end

#hostname(argument = nil) ⇒ Object



32
33
34
35
# File 'lib/jstp/configuration.rb', line 32

def hostname argument = nil
  @hostname = argument unless argument.nil?
  @hostname
end

#hostname=(argument) ⇒ Object



37
38
39
# File 'lib/jstp/configuration.rb', line 37

def hostname= argument
  hostname argument
end

#logger(argument = nil) ⇒ Object



41
42
43
44
# File 'lib/jstp/configuration.rb', line 41

def logger argument = nil
  @logger = argument unless argument.nil?
  @logger
end

#logger=(argument) ⇒ Object



46
47
48
# File 'lib/jstp/configuration.rb', line 46

def logger= argument
  logger argument
end

#port(argument = nil) ⇒ Object



14
15
16
17
# File 'lib/jstp/configuration.rb', line 14

def port argument = nil
  @port = SymbolMatrix argument unless argument.nil?
  @port
end

#port=(argument) ⇒ Object



19
20
21
# File 'lib/jstp/configuration.rb', line 19

def port= argument
  port argument
end

#strategy(argument = nil) ⇒ Object



23
24
25
26
# File 'lib/jstp/configuration.rb', line 23

def strategy argument = nil
  @strategy = SymbolMatrix argument unless argument.nil?
  @strategy
end

#strategy=(argument) ⇒ Object



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

def strategy= argument
  strategy argument
end