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
187 188 189 |
# File 'lib/drip.rb', line 187 def fname @fname end |
#fpos ⇒ Object
Returns the value of attribute fpos
187 188 189 |
# File 'lib/drip.rb', line 187 def fpos @fpos end |
#value ⇒ Object
Returns the value of attribute value
187 188 189 |
# File 'lib/drip.rb', line 187 def value @value end |
Instance Method Details
#forget ⇒ Object
193 194 195 |
# File 'lib/drip.rb', line 193 def forget self.value = nil end |
#retrieve ⇒ Object
197 198 199 200 201 202 203 |
# File 'lib/drip.rb', line 197 def retrieve File.open(fname) do |fp| fp.seek(fpos) kv = Marshal.load(fp) kv[1] end end |
#to_a ⇒ Object
189 190 191 |
# File 'lib/drip.rb', line 189 def to_a value || retrieve end |