Class: Presentation::SlideDSL
- Inherits:
-
Object
- Object
- Presentation::SlideDSL
show all
- Defined in:
- lib/presentation/dsl.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
35
36
37
38
39
40
41
|
# File 'lib/presentation/dsl.rb', line 35
def method_missing(method, *args, &block)
if method =~ /(.*)_code$/
code($1, *args, &block)
else
slide.send("#{method}=", *args, &block)
end
end
|
Instance Method Details
#bullet(bullet) ⇒ Object
Also known as:
b
48
49
50
51
|
# File 'lib/presentation/dsl.rb', line 48
def bullet(bullet)
slide.list ||= []
slide.list << bullet
end
|
#code(language, text) ⇒ Object
43
44
45
46
|
# File 'lib/presentation/dsl.rb', line 43
def code(language, text)
slide.code = text
end
|
#slide ⇒ Object
31
32
33
|
# File 'lib/presentation/dsl.rb', line 31
def slide
@slide ||= Slide.new
end
|