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.
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_comment ⇒ Object 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_comment ⇒ Object
15 16 17 |
# File 'lib/dice_bag/warning.rb', line 15 def as_xml_comment ["<!--", lines, "-->"].flatten.join("\n") end |