Class: DiceBag::Warning
- Inherits:
-
Object
- Object
- DiceBag::Warning
- Defined in:
- lib/dice_bag/warning.rb
Instance Method Summary collapse
- #as_ruby_comment ⇒ Object (also: #as_yaml_comment)
- #as_xml_comment ⇒ Object
-
#initialize(template_filename) ⇒ Warning
constructor
A new instance of Warning.
Constructor Details
#initialize(template_filename) ⇒ Warning
Returns a new instance of Warning.
3 4 5 |
# File 'lib/dice_bag/warning.rb', line 3 def initialize(template_filename) @template_filename = template_filename end |
Instance Method Details
#as_ruby_comment ⇒ Object Also known as: as_yaml_comment
7 8 9 |
# File 'lib/dice_bag/warning.rb', line 7 def as_ruby_comment lines.map { |line| "# #{line}".rstrip }.join("\n") + "\n" end |
#as_xml_comment ⇒ Object
13 14 15 |
# File 'lib/dice_bag/warning.rb', line 13 def as_xml_comment ["<!--", lines, "-->"].flatten.join("\n") end |