Class: Construqt::Flavour::Ubuntu::EtcNetworkVrrp::Vrrp
- Inherits:
-
Object
- Object
- Construqt::Flavour::Ubuntu::EtcNetworkVrrp::Vrrp
- Defined in:
- lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb
Instance Method Summary collapse
- #add_backup(backup) ⇒ Object
- #add_master(master) ⇒ Object
-
#initialize ⇒ Vrrp
constructor
A new instance of Vrrp.
- #render(lines, direction) ⇒ Object
- #render_backups ⇒ Object
- #render_masters ⇒ Object
Constructor Details
#initialize ⇒ Vrrp
Returns a new instance of Vrrp.
392 393 394 395 |
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 392 def initialize @masters = [] @backups = [] end |
Instance Method Details
#add_backup(backup) ⇒ Object
402 403 404 405 |
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 402 def add_backup(backup) @backups << backup self end |
#add_master(master) ⇒ Object
397 398 399 400 |
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 397 def add_master(master) @masters << master self end |
#render(lines, direction) ⇒ Object
407 408 409 410 411 412 413 414 |
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 407 def render(lines, direction) lines.map do |line| [ " logger '#{direction}#{line}'", " #{line}" ] end.join("\n") end |
#render_backups ⇒ Object
420 421 422 |
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 420 def render_backups render(@backups, 'STOPPING:') end |
#render_masters ⇒ Object
416 417 418 |
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 416 def render_masters render(@masters, 'STARTING:') end |