Class: Zold::Head::Cached

Inherits:
Object
  • Object
show all
Defined in:
lib/zold/head.rb

Overview

Cached head.

Author

Yegor Bugayenko ([email protected])

Copyright

Copyright © 2018 Yegor Bugayenko

License

MIT

Instance Method Summary collapse

Constructor Details

#initialize(txns) ⇒ Cached

Returns a new instance of Cached.



52
53
54
# File 'lib/zold/head.rb', line 52

def initialize(txns)
  @txns = txns
end

Instance Method Details

#fetchObject



60
61
62
# File 'lib/zold/head.rb', line 60

def fetch
  @fetch ||= @txns.fetch
end

#flushObject



56
57
58
# File 'lib/zold/head.rb', line 56

def flush
  @fetch = nil
end