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
#json_file?(file) ⇒ Boolean
10 11 12 13 14 15 |
# File 'lib/avm/eac_webapp_base0/file_formats/json.rb', line 10 def json_file?(file) ::JSON.parse(::File.read(file)) true rescue JSON::ParserError false end |
#string_apply(string) ⇒ String
19 20 21 |
# File 'lib/avm/eac_webapp_base0/file_formats/json.rb', line 19 def string_apply(string) super(::JSON.pretty_generate(::JSON.parse(string))) end |