Class: Drip::SimpleStore::Attic
- Inherits:
-
Struct
- Object
- Struct
- Drip::SimpleStore::Attic
- Defined in:
- lib/drip.rb,
lib/drip.rb
Instance Attribute Summary collapse
-
#fname ⇒ Object
Returns the value of attribute fname.
-
#fpos ⇒ Object
Returns the value of attribute fpos.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#fname ⇒ Object
Returns the value of attribute fname
209 210 211 |
# File 'lib/drip.rb', line 209 def fname @fname end |
#fpos ⇒ Object
Returns the value of attribute fpos
209 210 211 |
# File 'lib/drip.rb', line 209 def fpos @fpos end |
#value ⇒ Object
Returns the value of attribute value
209 210 211 |
# File 'lib/drip.rb', line 209 def value @value end |
Instance Method Details
#forget ⇒ Object
215 216 217 |
# File 'lib/drip.rb', line 215 def forget self.value = nil end |
#retrieve ⇒ Object
219 220 221 222 223 224 225 |
# File 'lib/drip.rb', line 219 def retrieve File.open(fname) do |fp| fp.seek(fpos) kv = Marshal.load(fp) kv[1] end end |
#to_a ⇒ Object
211 212 213 |
# File 'lib/drip.rb', line 211 def to_a value || retrieve end |