Class: Rabbit::SourceGenerator::RD
- Inherits:
-
Object
- Object
- Rabbit::SourceGenerator::RD
- Includes:
- GetText, PathManipulatable
- Defined in:
- lib/rabbit/source-generator/rd.rb
Constant Summary
Constants included from GetText
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
- #comment(content) ⇒ Object
- #definition_list_item(item, description) ⇒ Object
- #heading(level, title) ⇒ Object
- #image(source, options = {}) ⇒ Object
-
#initialize(logger = nil) ⇒ RD
constructor
A new instance of RD.
- #preformatted_line(content) ⇒ Object
- #unordered_list_item(item) ⇒ Object
Methods included from GetText
Constructor Details
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
25 26 27 |
# File 'lib/rabbit/source-generator/rd.rb', line 25 def logger @logger end |
Instance Method Details
#comment(content) ⇒ Object
60 61 62 |
# File 'lib/rabbit/source-generator/rd.rb', line 60 def comment(content) "# #{content}" end |
#definition_list_item(item, description) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/rabbit/source-generator/rd.rb', line 34 def definition_list_item(item, description) [ ": #{item}", " #{description}", ].join("\n") end |
#heading(level, title) ⇒ Object
30 31 32 |
# File 'lib/rabbit/source-generator/rd.rb', line 30 def heading(level, title) ("=" * level) + " #{title}" end |
#image(source, options = {}) ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/rabbit/source-generator/rd.rb', line 45 def image(source, ={}) lines = [ " # image", " # src = #{source}", ] .each do |key, value| lines << " # #{key} = #{value}" end lines.join("\n") end |
#preformatted_line(content) ⇒ Object
56 57 58 |
# File 'lib/rabbit/source-generator/rd.rb', line 56 def preformatted_line(content) " #{content}" end |
#unordered_list_item(item) ⇒ Object
41 42 43 |
# File 'lib/rabbit/source-generator/rd.rb', line 41 def unordered_list_item(item) " * #{item}" end |