Class: TShield::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/tshield/options.rb

Overview

Options for command line

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Options

Returns a new instance of Options.



21
22
23
24
# File 'lib/tshield/options.rb', line 21

def initialize(options = {})
  @options = {}
  parse unless options[:skip_parse]
end

Instance Attribute Details

#debugObject (readonly)

Returns the value of attribute debug.



11
12
13
# File 'lib/tshield/options.rb', line 11

def debug
  @debug
end

Class Method Details

.init(options = {}) ⇒ Object



13
14
15
# File 'lib/tshield/options.rb', line 13

def self.init(options = {})
  @instance = TShield::Options.new(options)
end

.instanceObject



17
18
19
# File 'lib/tshield/options.rb', line 17

def self.instance
  @instance || TShield::Options.new
end

Instance Method Details

#configuration_fileObject



26
27
28
# File 'lib/tshield/options.rb', line 26

def configuration_file
  @options.fetch(:configuration_file, 'config/tshield.yml')
end

#portObject



30
31
32
# File 'lib/tshield/options.rb', line 30

def port
  @options.fetch(:port, 4567)
end