Class: Ngenie::Builder::DomainBuilder

Inherits:
BaseBuilder show all
Defined in:
lib/ngenie/builder/domain_builder.rb

Constant Summary

Constants inherited from BaseBuilder

BaseBuilder::DEFAULT_BIND, BaseBuilder::DEFAULT_PORT

Instance Attribute Summary collapse

Attributes inherited from BaseBuilder

#blueprint, #name

Instance Method Summary collapse

Methods inherited from BaseBuilder

#build, #get_template, #method_missing, #respond_to?, #set_template

Constructor Details

#initialize(name) ⇒ DomainBuilder

Returns a new instance of DomainBuilder.



5
6
7
8
9
# File 'lib/ngenie/builder/domain_builder.rb', line 5

def initialize(name)
  super(name)

  @routes    = ''
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ngenie::Builder::BaseBuilder

Instance Attribute Details

#file_nameObject

Returns the value of attribute file_name.



3
4
5
# File 'lib/ngenie/builder/domain_builder.rb', line 3

def file_name
  @file_name
end

#routesObject

Returns the value of attribute routes.



3
4
5
# File 'lib/ngenie/builder/domain_builder.rb', line 3

def routes
  @routes
end

Instance Method Details

#route(arg = '', &blk) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/ngenie/builder/domain_builder.rb', line 11

def route(arg='', &blk)
  if arg.empty?
    @routes
  else
    @routes += Docile.dsl_eval(RouteBuilder.new(arg), &blk).build
  end
end