Class: LLT::DbHandler::Prometheus

Inherits:
CommonDb
  • Object
show all
Extended by:
Forwardable
Includes:
Helpers::Constantize, Helpers::PrimitiveCache
Defined in:
lib/llt/db_handler/prometheus.rb,
lib/llt/db_handler/prometheus/stats.rb,
lib/llt/db_handler/prometheus/db_to_lemma.rb

Defined Under Namespace

Modules: DbToLemma Classes: Stats

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cache: false) ⇒ Prometheus

Returns a new instance of Prometheus.



22
23
24
25
# File 'lib/llt/db_handler/prometheus.rb', line 22

def initialize(cache: false)
  @type = :prometheus
  enable_cache if cache
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



20
21
22
# File 'lib/llt/db_handler/prometheus.rb', line 20

def type
  @type
end

Instance Method Details

#direct_lookup(table, string) ⇒ Object



27
28
29
# File 'lib/llt/db_handler/prometheus.rb', line 27

def direct_lookup(table, string)
  query_db(table, string)
end

#look_up_stem(args) ⇒ Object



31
32
33
# File 'lib/llt/db_handler/prometheus.rb', line 31

def look_up_stem(args)
  cached(args) { new_lookup(args) }
end

#statsObject



35
36
37
# File 'lib/llt/db_handler/prometheus.rb', line 35

def stats
  @stats ||= Stats.new
end