Class: Construqt::Templates::Template

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/construqt/templates.rb

Instance Method Summary collapse

Constructor Details

#initialize(cfg) ⇒ Template

Returns a new instance of Template.



10
11
12
# File 'lib/construqt/templates.rb', line 10

def initialize(cfg)
  super(cfg)
end

Instance Method Details

#is_nountagged?(vlan_id) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
33
34
35
36
# File 'lib/construqt/templates.rb', line 30

def is_nountagged?(vlan_id)
  self.vlans.each do |vlan|
    return vlan.nountagged? if vlan.vlan_id == vlan_id
  end

  throw "vlan with id #{vlan_id} not found in template #{self}"
end

#is_tagged?(vlan_id) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
# File 'lib/construqt/templates.rb', line 14

def is_tagged?(vlan_id)
  self.vlans.each do |vlan|
    return vlan.tagged? if vlan.vlan_id == vlan_id
  end

  throw "vlan with id #{vlan_id} not found in template #{self}"
end

#is_untagged?(vlan_id) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
25
26
27
28
# File 'lib/construqt/templates.rb', line 22

def is_untagged?(vlan_id)
  self.vlans.each do |vlan|
    return vlan.untagged? if vlan.vlan_id == vlan_id
  end

  throw "vlan with id #{vlan_id} not found in template #{self}"
end