Class: Rna::DSL::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/rna/dsl.rb

Direct Known Subclasses

Role, Rule

Instance Method Summary collapse

Instance Method Details

#buildObject



123
124
125
126
127
128
129
130
# File 'lib/rna/dsl.rb', line 123

def build
  if @block
    @dsl = eval "self", @block.binding
    instance_eval(&@block)
  end        
  @data[:attributes].deep_merge!(set.to_mash)
  @data
end

#nodeObject Also known as: set



137
138
139
# File 'lib/rna/dsl.rb', line 137

def node
  @node ||= Node.new
end

#role_list(list) ⇒ Object



142
143
144
145
# File 'lib/rna/dsl.rb', line 142

def role_list(list)
  list = list.collect {|i| "role[#{i}]"}
  run_list(list)
end

#run_list(list) ⇒ Object



147
148
149
# File 'lib/rna/dsl.rb', line 147

def run_list(list)
  node[:run_list] = list
end

#settingsObject



133
134
135
# File 'lib/rna/dsl.rb', line 133

def settings
  @dsl.settings.to_mash
end