Class: Dragonfly::Cache::Mapper::Yaml

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/dragonfly/cache/mapper/yaml.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Yaml

Returns a new instance of Yaml.



15
16
17
18
19
# File 'lib/dragonfly/cache/mapper/yaml.rb', line 15

def initialize(config)
  @root = config[:server_root]
  @internal = {}
  load!
end

Instance Attribute Details

#internalObject (readonly)

Returns the value of attribute internal.



11
12
13
# File 'lib/dragonfly/cache/mapper/yaml.rb', line 11

def internal
  @internal
end

#rootObject (readonly)

Returns the value of attribute root.



11
12
13
# File 'lib/dragonfly/cache/mapper/yaml.rb', line 11

def root
  @root
end

Instance Method Details

#store(key, value) ⇒ Object Also known as: []=



21
22
23
24
# File 'lib/dragonfly/cache/mapper/yaml.rb', line 21

def store(key, value)
  @internal[key] = value
  save!
end