Class: Phut::Syntax

Inherits:
Object
  • Object
show all
Defined in:
lib/phut/syntax.rb

Overview

DSL syntax definitions.

Defined Under Namespace

Classes: VhostDirective, VswitchDirective

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Syntax

Returns a new instance of Syntax.



78
79
80
# File 'lib/phut/syntax.rb', line 78

def initialize(config)
  @config = config
end

Instance Method Details



92
93
94
# File 'lib/phut/syntax.rb', line 92

def link(name_a, name_b)
  @config.add_link name_a, name_b
end

#vhost(alias_name = nil, &block) ⇒ Object



87
88
89
90
# File 'lib/phut/syntax.rb', line 87

def vhost(alias_name = nil, &block)
  attrs = VhostDirective.new(alias_name, &block)
  @config.add_vhost attrs[:name], attrs
end

#vswitch(alias_name = nil, &block) ⇒ Object



82
83
84
85
# File 'lib/phut/syntax.rb', line 82

def vswitch(alias_name = nil, &block)
  attrs = VswitchDirective.new(alias_name, &block)
  @config.add_vswitch attrs[:name], attrs
end