Module: Hashdown::Finder::ClassMethods

Defined in:
lib/hashdown/finder.rb

Instance Method Summary collapse

Instance Method Details

#[](token) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/hashdown/finder.rb', line 22

def [](token)
  cache_key = Hashdown.cache_key(:finder, self.to_s, token)

  Hashdown.cached(cache_key) do
    where({hashdown.finder.key => token.to_s}).first || hashdown_default_or_raise
  end
end

#hashdownObject



18
19
20
# File 'lib/hashdown/finder.rb', line 18

def hashdown
  @hashdown ||= Config.new
end