Class: Scaffoldish::Scaffold

Inherits:
Object
  • Object
show all
Includes:
DSL::Template
Defined in:
lib/scaffoldish/scaffold.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DSL::Template

#chunk, #generate

Constructor Details

#initialize(name, &block) ⇒ Scaffold

Returns a new instance of Scaffold.



12
13
14
15
# File 'lib/scaffoldish/scaffold.rb', line 12

def initialize(name, &block)
  @name  = name
  @block = block || Proc.new {}
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



10
11
12
# File 'lib/scaffoldish/scaffold.rb', line 10

def block
  @block
end

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/scaffoldish/scaffold.rb', line 10

def name
  @name
end

Instance Method Details

#run(*args) ⇒ Object



17
18
19
# File 'lib/scaffoldish/scaffold.rb', line 17

def run(*args)
  instance_exec(*args, &block)
end