Class: StupidFormatter::AbstractFormatter
- Inherits:
-
Object
- Object
- StupidFormatter::AbstractFormatter
- Defined in:
- lib/stupid_formatter.rb
Overview
Base class for formatters, providing the basic API.
Instance Attribute Summary (collapse)
-
- (Object) input
readonly
Returns the value of attribute input.
Instance Method Summary (collapse)
-
- (AbstractFormatter) initialize(input)
constructor
A new instance of AbstractFormatter.
- - (Object) result
Constructor Details
- (AbstractFormatter) initialize(input)
A new instance of AbstractFormatter
50 51 52 53 |
# File 'lib/stupid_formatter.rb', line 50 def initialize(input) @input = input.to_s.strip raise "Please use this only in subclasses" if self.class == AbstractFormatter end |
Instance Attribute Details
- (Object) input (readonly)
Returns the value of attribute input
48 49 50 |
# File 'lib/stupid_formatter.rb', line 48 def input @input end |
Instance Method Details
- (Object) result
55 56 57 |
# File 'lib/stupid_formatter.rb', line 55 def result raise "This should be implemented by subclasses" end |