Module: Bricks::DSL

Included in:
Builder, BuilderSet
Defined in:
lib/bricks/dsl.rb

Instance Method Summary collapse

Instance Method Details

#build(klass) ⇒ Object



3
4
5
# File 'lib/bricks/dsl.rb', line 3

def build(klass)
  builder(klass, false)
end

#build!(klass) ⇒ Object



7
8
9
# File 'lib/bricks/dsl.rb', line 7

def build!(klass)
  build(klass).generate
end

#build?(klass) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/bricks/dsl.rb', line 11

def build?(klass)
  build(klass).generate(:search => true)
end

#builder(klass, save) ⇒ Object



27
28
29
# File 'lib/bricks/dsl.rb', line 27

def builder(klass, save)
  Bricks.builders[klass].derive(:save => save)
end

#create(klass) ⇒ Object



15
16
17
# File 'lib/bricks/dsl.rb', line 15

def create(klass)
  builder(klass, true)
end

#create!(klass) ⇒ Object



19
20
21
# File 'lib/bricks/dsl.rb', line 19

def create!(klass)
  create(klass).generate
end

#create?(klass) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/bricks/dsl.rb', line 23

def create?(klass)
  create(klass).generate(:search => true)
end