class Construqt::Flavour::FlavourDelegate

Attributes

flavour[R]

Public Class Methods

new(flavour) click to toggle source
# File lib/construqt/flavour/flavour.rb, line 9
def initialize(flavour)
  @flavour = flavour
end

Public Instance Methods

bgp() click to toggle source
# File lib/construqt/flavour/flavour.rb, line 21
def bgp
  @flavour.bgp
end
clazzes() click to toggle source
# File lib/construqt/flavour/flavour.rb, line 25
def clazzes
  ret = {
    "opvn" => OpvnDelegate,
    "gre" => GreDelegate,
    "host" => HostDelegate,
    "device"=> DeviceDelegate,
    "vrrp" => VrrpDelegate,
    "bridge" => BridgeDelegate,
    "bond" => BondDelegate,
    "vlan" => VlanDelegate,
    #"result" => ResultDelegate,
    "template" => TemplateDelegate
  }
end
create_bgp(cfg) click to toggle source
# File lib/construqt/flavour/flavour.rb, line 66
def create_bgp(cfg)
  BgpDelegate.new(@flavour.create_bgp(cfg))
end
create_host(name, cfg) click to toggle source

def clazz(name)

delegate = self.clazzes[name]
throw "class not found #{name}" unless delegate
flavour = @flavour.clazz(name)
throw "class not found #{name}" unless flavour
delegate.new(flavour)

end

# File lib/construqt/flavour/flavour.rb, line 54
def create_host(name, cfg)
  HostDelegate.new(@flavour.create_host(name, cfg))
end
create_interface(dev_name, cfg) click to toggle source

def create_result(name, cfg)

HostDelegate.new(@flavour.create_host(name, cfg))

end

# File lib/construqt/flavour/flavour.rb, line 62
def create_interface(dev_name, cfg)
  clazzes[cfg['clazz']].new(@flavour.create_interface(dev_name, cfg))
end
create_ipsec(cfg) click to toggle source
# File lib/construqt/flavour/flavour.rb, line 70
def create_ipsec(cfg)
  IpsecDelegate.new(@flavour.create_ipsec(cfg))
end
ipsec() click to toggle source
# File lib/construqt/flavour/flavour.rb, line 17
def ipsec
  @flavour.ipsec
end
name() click to toggle source
# File lib/construqt/flavour/flavour.rb, line 13
def name
  @flavour.name
end
pre_clazzes(&block) click to toggle source
# File lib/construqt/flavour/flavour.rb, line 40
def pre_clazzes(&block)
  @flavour.clazzes.each do |key, clazz|
    block.call(key, clazz)
  end
end