Class: DiceBag::Warning

Inherits:
Object
  • Object
show all
Defined in:
lib/dice_bag/warning.rb

Instance Method Summary collapse

Constructor Details

#initialize(template_filename) ⇒ Warning

Returns a new instance of Warning.



5
6
7
# File 'lib/dice_bag/warning.rb', line 5

def initialize(template_filename)
  @template_filename = template_filename
end

Instance Method Details

#as_ruby_commentObject Also known as: as_yaml_comment



9
10
11
# File 'lib/dice_bag/warning.rb', line 9

def as_ruby_comment
  lines.map { |line| "# #{line}".rstrip }.join("\n") + "\n"
end

#as_xml_commentObject



15
16
17
# File 'lib/dice_bag/warning.rb', line 15

def as_xml_comment
  ["<!--", lines, "-->"].flatten.join("\n")
end