Class: Moneta::Xattr
- Inherits:
-
Object
- Object
- Moneta::Xattr
- Includes:
- Defaults, Implementation
- Defined in:
- lib/moneta/xattr.rb
Defined Under Namespace
Modules: Implementation
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Xattr
constructor
A new instance of Xattr.
Methods included from Implementation
#[], #[]=, #clear, #delete, #key?
Methods included from Defaults
Constructor Details
#initialize(options = {}) ⇒ Xattr
Returns a new instance of Xattr.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/moneta/xattr.rb', line 13 def initialize( = {}) file = [:file] @hash = ::Xattr.new(file) FileUtils.mkdir_p(::File.dirname(file)) FileUtils.touch(file) unless [:skip_expires] @expiration = Moneta::Xattr.new(:file => "#{file}_expiration", :skip_expires => true) self.extend(Expires) end end |