Class: Avm::EacWebappBase0::FileFormats::Json
- Inherits:
-
Avm::EacGenericBase0::FileFormats::Base
- Object
- Avm::EacGenericBase0::FileFormats::Base
- Avm::EacWebappBase0::FileFormats::Json
- Defined in:
- lib/avm/eac_webapp_base0/file_formats/json.rb
Constant Summary collapse
- VALID_BASENAMES =
%w[*.json].freeze
- VALID_TYPES =
[].freeze
Instance Method Summary collapse
Instance Method Details
#file_apply(file) ⇒ Object
12 13 14 |
# File 'lib/avm/eac_webapp_base0/file_formats/json.rb', line 12 def file_apply(file) ::File.write(file, ::JSON.pretty_generate(::JSON.parse(::File.read(file)))) end |
#json_file?(file) ⇒ Boolean
16 17 18 19 20 21 |
# File 'lib/avm/eac_webapp_base0/file_formats/json.rb', line 16 def json_file?(file) ::JSON.parse(::File.read(file)) true rescue JSON::ParserError false end |