Class: CodeFormatter::Formatter
- Inherits:
-
Object
- Object
- CodeFormatter::Formatter
- Defined in:
- lib/code_formatter/formatters/formatter.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(config, path) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize(config, path) ⇒ Formatter
Returns a new instance of Formatter.
8 9 10 11 12 13 |
# File 'lib/code_formatter/formatters/formatter.rb', line 8 def initialize(config, path) raise TypeError unless config.is_a? Configuration raise TypeError unless Dir.exist?(path) @config = config @path = path end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
5 6 7 |
# File 'lib/code_formatter/formatters/formatter.rb', line 5 def config @config end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/code_formatter/formatters/formatter.rb', line 6 def path @path end |
Instance Method Details
#format ⇒ Object
15 16 17 |
# File 'lib/code_formatter/formatters/formatter.rb', line 15 def format raise NotImplementedError end |