Class: Renogen::Formatters::Base
- Inherits:
-
Object
- Object
- Renogen::Formatters::Base
- Defined in:
- lib/renogen/formatters/base.rb
Overview
Implements a template pattern that forces the implemention of required methods in sub classes
Class Method Summary collapse
-
.register(identifier) ⇒ Object
Adds class with identifier to formatters.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
-
#write_change(change) ⇒ NotImplementedError
Outputs a line or block as the body for a change.
-
#write_footer(changelog) ⇒ nil
Outputs a line or block of text appearing at the bottom of the change log.
-
#write_group(group) ⇒ NotImplementedError
Outputs a line or block as a header for a group.
-
#write_group_end ⇒ nil
Outputs a line or block of text appearing after a group.
-
#write_header(header) ⇒ NotImplementedError
Outputs a line or block of text appearing at the top of the change log.
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
6 7 |
# File 'lib/renogen/formatters/base.rb', line 6 def initialize(={}) end |
Class Method Details
.register(identifier) ⇒ Object
Adds class with identifier to formatters
12 13 14 |
# File 'lib/renogen/formatters/base.rb', line 12 def self.register(identifier) Renogen::Formatters.add(identifier.to_sym, self) end |
Instance Method Details
#write_change(change) ⇒ NotImplementedError
Outputs a line or block as the body for a change.
42 43 44 |
# File 'lib/renogen/formatters/base.rb', line 42 def write_change(change) raise NotImplementedError end |
#write_footer(changelog) ⇒ nil
Outputs a line or block of text appearing at the bottom of the change log.
50 51 |
# File 'lib/renogen/formatters/base.rb', line 50 def (changelog) end |
#write_group(group) ⇒ NotImplementedError
Outputs a line or block as a header for a group.
28 29 30 |
# File 'lib/renogen/formatters/base.rb', line 28 def write_group(group) raise NotImplementedError end |
#write_group_end ⇒ nil
Outputs a line or block of text appearing after a group.
35 36 |
# File 'lib/renogen/formatters/base.rb', line 35 def write_group_end end |
#write_header(header) ⇒ NotImplementedError
Outputs a line or block of text appearing at the top of the change log.
20 21 22 |
# File 'lib/renogen/formatters/base.rb', line 20 def write_header(header) raise NotImplementedError end |