Class: Pione::System::FileCache::FileCacheMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/pione/system/file-cache.rb

Overview

FileCache is an interface class of cache methods.

Direct Known Subclasses

NoCacheMethod, SimpleCacheMethod

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.nameString

Return the name.

Returns:

  • (String)

    the name



115
116
117
# File 'lib/pione/system/file-cache.rb', line 115

def self.name
  @name
end

.set_name(name) ⇒ Object

Name the file cache method class.

Parameters:

  • name (String)

    cache mtehod name



107
108
109
110
# File 'lib/pione/system/file-cache.rb', line 107

def self.set_name(name)
  @name = name
  FileCache.register_file_cache_method(name, self)
end

Instance Method Details

#cached?(location) ⇒ Boolean

Return true if the location is cached.

Returns:

  • (Boolean)

    true if the location is cached

Raises:

  • (NotImplementedError)


155
156
157
# File 'lib/pione/system/file-cache.rb', line 155

def cached?(location)
  raise NotImplementedError
end

#clearvoid

This method returns an undefined value.

Clear cache.

Raises:

  • (NotImplementedError)


162
163
164
# File 'lib/pione/system/file-cache.rb', line 162

def clear
  raise NotImplementedError
end

#get(location) ⇒ BasicLocalLocation

Get the cache path of the location.

Parameters:

  • location (BasicLocation)

    data location

Returns:

  • (BasicLocalLocation)

    cached path

Raises:

  • (NotImplementedError)


125
126
127
# File 'lib/pione/system/file-cache.rb', line 125

def get(location)
  raise NotImplementedError
end

#put(src, location) ⇒ void

This method returns an undefined value.

Put and cache the source data at the location.

Parameters:

  • src (BasicLocation)

    source path

  • location (BasicLocation)

    destination

Raises:

  • (NotImplementedError)


136
137
138
# File 'lib/pione/system/file-cache.rb', line 136

def put(src, location)
  raise NotImplementedError
end

#sync(old_location, new_location) ⇒ void

This method returns an undefined value.

Synchronize cache of old location with new location.

Parameters:

  • old_location (BasicLocation)

    old data location

  • new_location (BasicLocation)

    new data location

Raises:

  • (NotImplementedError)


147
148
149
# File 'lib/pione/system/file-cache.rb', line 147

def sync(old_location, new_location)
  raise NotImplementedError
end