lib/picky/backend/file/json.rb in picky-2.7.0 vs lib/picky/backend/file/json.rb in picky-3.0.0.pre1

- old
+ new

@@ -1,31 +1,35 @@ -module Backend +module Picky - module File + module Backend - # Index files dumped in the JSON format. - # - class JSON < Basic + module File - # Uses the extension "json". + # Index files dumped in the JSON format. # - def extension - :json - end - # Loads the index hash from json format. - # - def load - Yajl::Parser.parse ::File.open(cache_path, 'r'), symbolize_keys: true - end - # Dumps the index hash in json format. - # - def dump hash - hash.dump_json cache_path - end - # A json file does not provide retrieve functionality. - # - def retrieve - raise "Can't retrieve from JSON file. Use text file." + class JSON < Basic + + # Uses the extension "json". + # + def extension + :json + end + # Loads the index hash from json format. + # + def load + Yajl::Parser.parse ::File.open(cache_path, 'r'), symbolize_keys: true + end + # Dumps the index hash in json format. + # + def dump hash + hash.dump_json cache_path + end + # A json file does not provide retrieve functionality. + # + def retrieve + raise "Can't retrieve from JSON file. Use text file." + end + end end end \ No newline at end of file