Sha256: 2340fccce1ab9a895cf807d263a3baf8970e20ece000d7f3bb736ae756cbe4a3

Contents?: true

Size: 751 Bytes

Versions: 24

Compression:

Stored size: 751 Bytes

Contents

module Internals

  module Index
  
    module File
    
      # Index files dumped in the JSON format.
      #
      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
  
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
picky-2.5.2 lib/picky/internals/index/file/json.rb
picky-2.5.1 lib/picky/internals/index/file/json.rb
picky-2.5.0 lib/picky/internals/index/file/json.rb
picky-2.4.3 lib/picky/internals/index/file/json.rb
picky-2.4.2 lib/picky/internals/index/file/json.rb
picky-2.4.1 lib/picky/internals/index/file/json.rb
picky-2.4.0 lib/picky/internals/index/file/json.rb
picky-2.3.0 lib/picky/internals/index/file/json.rb
picky-2.2.1 lib/picky/internals/index/file/json.rb
picky-2.2.0 lib/picky/internals/index/file/json.rb
picky-2.1.2 lib/picky/internals/index/file/json.rb
picky-2.1.1 lib/picky/internals/index/file/json.rb
picky-2.1.0 lib/picky/internals/index/file/json.rb
picky-2.0.0 lib/picky/internals/index/file/json.rb
picky-2.0.0.pre3 lib/picky/internals/index/file/json.rb
picky-2.0.0.pre2 lib/picky/internals/index/file/json.rb
picky-2.0.0.pre1 lib/picky/internals/index/file/json.rb
picky-1.5.4 lib/picky/internals/index/file/json.rb
picky-1.5.3 lib/picky/internals/index/file/json.rb
picky-1.5.2 lib/picky/internals/index/file/json.rb