Class: Moneta::YAML
- Inherits:
-
Object
- Object
- Moneta::YAML
- Includes:
- Defaults, Expires, Implementation
- Defined in:
- lib/moneta/yaml.rb
Defined Under Namespace
Modules: Implementation Classes: Expiration
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ YAML
constructor
A new instance of YAML.
Methods included from Expires
#[], #check_expired, #delete, #fetch, #key?, #store, #update_key
Methods included from Defaults
Methods included from Implementation
#[], #[]=, #clear, #delete, #key?
Constructor Details
#initialize(options = {}) ⇒ YAML
Returns a new instance of YAML.
41 42 43 44 45 46 47 48 |
# File 'lib/moneta/yaml.rb', line 41 def initialize( = {}) @file = File.([:path]) unless ::File.exists?(@file) File.open(@file, "w") { |file| file << {}.to_yaml } end @expiration = Expiration.new(@file) end |