Class: Money::Bank::ECB::CacheFile
- Inherits:
-
Object
- Object
- Money::Bank::ECB::CacheFile
- Includes:
- Cache
- Defined in:
- lib/money/bank/ecb/cache_file.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(path) ⇒ CacheFile
constructor
A new instance of CacheFile.
- #set(value) ⇒ Object
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
#path ⇒ Object (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
#get ⇒ Object
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 |