class Bifrossht::Config::Connection

Public Class Methods

new(options = {}) click to toggle source
Calls superclass method Bifrossht::Config::Element::new
# File lib/bifrossht/config/connection.rb, line 4
def initialize(options = {})
  super

  validate_presence 'type', 'name'
  validate_type 'type', String
  validate_type 'name', String
  validate_boolean 'skip_probe'
  validate_type 'parameters', Hash
  validate_type 'match', Array
  validate_type 'match_addr', Array
end

Public Instance Methods

match() click to toggle source
# File lib/bifrossht/config/connection.rb, line 32
def match
  return [] if @options['match'].nil?

  @options['match'].map { |re| Regexp.new re }
end
match_addr() click to toggle source
# File lib/bifrossht/config/connection.rb, line 38
def match_addr
  return [] if @options['match_addr'].nil?

  @options['match_addr'].map { |ip| IPAddr.new ip }
end
name() click to toggle source
# File lib/bifrossht/config/connection.rb, line 20
def name
  @options['name']
end
parameters() click to toggle source
# File lib/bifrossht/config/connection.rb, line 28
def parameters
  @options['parameters'] || {}
end
skip_probe() click to toggle source
# File lib/bifrossht/config/connection.rb, line 24
def skip_probe
  @options['skip_probe'] || false
end
type() click to toggle source
# File lib/bifrossht/config/connection.rb, line 16
def type
  @options['type']
end