Class: Rabbit::SourceGenerator::RD

Inherits:
Object
  • Object
show all
Includes:
GetText, PathManipulatable
Defined in:
lib/rabbit/source-generator/rd.rb

Constant Summary

Constants included from GetText

GetText::DOMAIN

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GetText

included

Constructor Details

#initialize(logger = nil) ⇒ RD

Returns a new instance of RD.


26
27
28
# File 'lib/rabbit/source-generator/rd.rb', line 26

def initialize(logger=nil)
  @logger = logger || Logger.default
end

Instance Attribute Details

#loggerObject

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, options={})
  lines = [
    "  # image",
    "  # src = #{source}",
  ]
  options.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