Class: LLT::DbHandler::Prometheus::Stats
- Inherits:
-
Object
- Object
- LLT::DbHandler::Prometheus::Stats
- Includes:
- Enumerable
- Defined in:
- lib/llt/db_handler/prometheus/stats.rb
Constant Summary collapse
- CATEGORIES =
%i{ noun adjective adverb verb persona ethnic place }
- TABLES =
CATEGORIES.map { |cat| cat.to_s.capitalize.prepend('Db').to_sym }
Instance Method Summary collapse
Instance Method Details
#all_entries ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/llt/db_handler/prometheus/stats.rb', line 14 def all_entries @all_entries ||= flat_map(&:all) if block_given? @all_entries.map { |entry| yield(entry) } else @all_entries end end |
#count ⇒ Object
10 11 12 |
# File 'lib/llt/db_handler/prometheus/stats.rb', line 10 def count @count ||= compute_count end |
#lemma_list(detailed = false) ⇒ Object
24 25 26 |
# File 'lib/llt/db_handler/prometheus/stats.rb', line 24 def lemma_list(detailed = false) all_entries.map { |entry| entry.to_lemma(detailed) } end |