Module: Computering::Dsl
- Included in:
- Container
- Defined in:
- lib/computering/dsl.rb,
lib/computering/dsl/code.rb,
lib/computering/dsl/link.rb,
lib/computering/dsl/list.rb,
lib/computering/dsl/spec.rb,
lib/computering/dsl/text.rb,
lib/computering/dsl/command.rb,
lib/computering/dsl/headline.rb
Defined Under Namespace
Classes: Code, Command, Headline, Link, List, Spec, Text
Instance Method Summary
collapse
Instance Method Details
#code(*text) ⇒ Object
23
24
25
|
# File 'lib/computering/dsl.rb', line 23
def code(*text)
self.items += Code.from_text(text)
end
|
#command(*text) ⇒ Object
27
28
29
|
# File 'lib/computering/dsl.rb', line 27
def command(*text)
self.items += Command.from_text(text)
end
|
3
4
5
|
# File 'lib/computering/dsl.rb', line 3
def configure(&block)
Config.instance_eval(&block)
end
|
#headline(*text) ⇒ Object
15
16
17
|
# File 'lib/computering/dsl.rb', line 15
def headline(*text)
self.items += Headline.from_text(text)
end
|
#items ⇒ Object
35
36
37
|
# File 'lib/computering/dsl.rb', line 35
def items
@items ||= []
end
|
#items=(items) ⇒ Object
39
40
41
|
# File 'lib/computering/dsl.rb', line 39
def items=(items)
@items = items
end
|
#link(text, link) ⇒ Object
31
32
33
|
# File 'lib/computering/dsl.rb', line 31
def link(text, link)
self.items += Link.from_text(text, link)
end
|
#list(*text) ⇒ Object
11
12
13
|
# File 'lib/computering/dsl.rb', line 11
def list(*text)
self.items += List.from_text(text)
end
|
#paragraph(*text) ⇒ Object
19
20
21
|
# File 'lib/computering/dsl.rb', line 19
def paragraph(*text)
self.items += Text.from_text(text)
end
|
#spec(name, &block) ⇒ Object
7
8
9
|
# File 'lib/computering/dsl.rb', line 7
def spec(name, &block)
self.items += Spec.from_block(name, block_source(name), &block)
end
|