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 = Dir.pwd) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize(config, path = Dir.pwd) ⇒ Formatter
Returns a new instance of Formatter.
10 11 12 13 14 15 |
# File 'lib/code_formatter/formatters/formatter.rb', line 10 def initialize(config, path = Dir.pwd) 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.
7 8 9 |
# File 'lib/code_formatter/formatters/formatter.rb', line 7 def config @config end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/code_formatter/formatters/formatter.rb', line 8 def path @path end |
Instance Method Details
#format ⇒ Object
17 18 19 |
# File 'lib/code_formatter/formatters/formatter.rb', line 17 def format(*) raise NotImplementedError end |