Class: Avm::Files::Formatter::Formats::Base
- Inherits:
-
Object
- Object
- Avm::Files::Formatter::Formats::Base
- Defined in:
- lib/avm/files/formatter/formats/base.rb
Direct Known Subclasses
Instance Method Summary collapse
- #apply(files) ⇒ Object
- #match?(file) ⇒ Boolean
- #name ⇒ Object
- #valid_basenames ⇒ Object
- #valid_types ⇒ Object
Instance Method Details
#apply(files) ⇒ Object
11 12 13 14 15 |
# File 'lib/avm/files/formatter/formats/base.rb', line 11 def apply(files) old_content = Hash[files.map { |f| [f, File.read(f)] }] ::Avm::Files::Formatter::Utf8Assert.assert_files(files) { internal_apply(files) } files.map { |f| build_file_result(f, old_content[f]) } end |
#match?(file) ⇒ Boolean
21 22 23 |
# File 'lib/avm/files/formatter/formats/base.rb', line 21 def match?(file) match_by_filename?(file) || match_by_type?(file) end |
#name ⇒ Object
17 18 19 |
# File 'lib/avm/files/formatter/formats/base.rb', line 17 def name self.class.name.demodulize end |
#valid_basenames ⇒ Object
25 26 27 |
# File 'lib/avm/files/formatter/formats/base.rb', line 25 def valid_basenames constant_or_array('VALID_BASENAMES') end |
#valid_types ⇒ Object
29 30 31 |
# File 'lib/avm/files/formatter/formats/base.rb', line 29 def valid_types constant_or_array('VALID_TYPES') end |