lib/demiurge/dsl.rb
# Start a new Zone block, using a ZoneBuilder.
Start a new Zone block, using a ZoneBuilder.
Start a new Zone block using a ZoneBuilder .
def zone(name, options = {}, &block)
      if @zones.any? { |z| z.name == name }
        builder = ZoneBuilder.new(name, @engine, options.merge("existing" => @zones.detect { |z| z.name == name }))
      else
        builder = ZoneBuilder.new(name, @engine, options)
      end
      builder.instance_eval(&block)
      new_zone = builder.built_item
      @zones |= [ new_zone ] if new_zone  
      nil
    end
def zone ( name , options = { } , & block ) if @zones . any? { | z | z . name == name } builder = ZoneBuilder . new ( name , @engine , options . merge ( "existing" => @zones . detect { | z | z . name == name } ) ) else builder = ZoneBuilder . new ( name , @engine , options ) end builder . instance_eval ( & block ) new_zone = builder . built_item @zones |= [ new_zone ] if new_zone nil end
Start a new Zone block, using a ZoneBuilder.
Start a new Zone block using a ZoneBuilder .
# Reopening an existing zone # Add if not already present
name
options
block