Class: Money::Bank::ECB::CacheFile

Inherits:
Object
  • Object
show all
Includes:
Cache
Defined in:
lib/money/bank/ecb/cache_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ CacheFile

Returns a new instance of CacheFile.



7
8
9
# File 'lib/money/bank/ecb/cache_file.rb', line 7

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



10
11
12
# File 'lib/money/bank/ecb/cache_file.rb', line 10

def path
  @path
end

Instance Method Details

#getObject



17
18
19
# File 'lib/money/bank/ecb/cache_file.rb', line 17

def get
  File.read(@path)
end

#set(value) ⇒ Object



12
13
14
15
# File 'lib/money/bank/ecb/cache_file.rb', line 12

def set(value)
  File.write(@path, value)
  value
end