Class: Trestle::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/trestle/builder.rb

Direct Known Subclasses

Admin::Builder, Table::Builder

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(*args, &block) ⇒ Object


8
9
10
# File 'lib/trestle/builder.rb', line 8

def self.build(*args, &block)
  new(*args).build(&block)
end

.target(name) ⇒ Object


3
4
5
6
# File 'lib/trestle/builder.rb', line 3

def self.target(name)
  attr_reader name
  alias_method :target, name
end

Instance Method Details

#build(&block) ⇒ Object


12
13
14
15
# File 'lib/trestle/builder.rb', line 12

def build(&block)
  instance_eval(&block) if block_given?
  target
end