Class: Webmanifest
- Inherits:
-
Object
- Object
- Webmanifest
- Defined in:
- lib/webmanifest.rb
Overview
Build Webmanifest JSON
Instance Attribute Summary collapse
-
#document ⇒ Object
Returns the value of attribute document.
Instance Method Summary collapse
Instance Attribute Details
#document ⇒ Object
Returns the value of attribute document.
3 4 5 |
# File 'lib/webmanifest.rb', line 3 def document @document end |
Instance Method Details
#dump ⇒ Object
14 15 16 |
# File 'lib/webmanifest.rb', line 14 def dump JSON.pretty_generate document end |
#load(source_path, config, prefix) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/webmanifest.rb', line 5 def load(source_path, config, prefix) @document = if File.exist? source_path JSON.parse File.read source_path else {} end add_webmanifest_elements config, prefix end |