Class: Zold::CachedHead

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(head) ⇒ CachedHead

Returns a new instance of CachedHead.



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

def initialize(head)
  @head = head
end

Instance Method Details

#fetchObject



67
68
69
# File 'lib/zold/head.rb', line 67

def fetch
  @fetch ||= @head.fetch
end

#flushObject



63
64
65
# File 'lib/zold/head.rb', line 63

def flush
  @fetch = nil
end