Class: Phut::Syntax::Directive

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

Overview

Common DSL directive

Direct Known Subclasses

NetnsDirective, VhostDirective, VswitchDirective

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.attribute(name) ⇒ Object



5
6
7
8
9
# File 'lib/phut/syntax/directive.rb', line 5

def self.attribute(name)
  define_method(name) do |value|
    @attributes[name] = value
  end
end

Instance Method Details

#[](key) ⇒ Object



11
12
13
# File 'lib/phut/syntax/directive.rb', line 11

def [](key)
  @attributes.fetch(key)
end