Class: Havox::DSL::DirectiveProxy
- Inherits:
-
Object
- Object
- Havox::DSL::DirectiveProxy
- Defined in:
- lib/havox/dsl/directive_proxy.rb
Instance Method Summary collapse
- #associate(router, switch) ⇒ Object
- #exit(switch, &block) ⇒ Object
-
#topology(file_path) ⇒ Object
def drop(&block) eval_directive(:drop, nil, &block) end.
Instance Method Details
#associate(router, switch) ⇒ Object
18 19 20 |
# File 'lib/havox/dsl/directive_proxy.rb', line 18 def associate(router, switch) Havox::Network.devices[router.to_s] = switch.to_s end |
#exit(switch, &block) ⇒ Object
4 5 6 |
# File 'lib/havox/dsl/directive_proxy.rb', line 4 def exit(switch, &block) eval_directive(:exit, switch, &block) end |
#topology(file_path) ⇒ Object
def drop(&block)
eval_directive(:drop, nil, &block)
end
12 13 14 15 16 |
# File 'lib/havox/dsl/directive_proxy.rb', line 12 def topology(file_path) raise_invalid_topology(file_path) unless File.exists?(file_path) topo = Havox::Topology.new(file_path) Havox::Network.topology = topo end |