module JosieHealth::LUT::DataFiles

Overview

Provides access to bundled data files

Defined in:

data_files.cr

Constant Summary

ALCOHOL_DATA = {{ read_file("/home/josie/development/personal/josiedot/health/josie-health-lut/src/../data/alcohol.json") }}
CAFFEINE_DATA = {{ read_file("/home/josie/development/personal/josiedot/health/josie-health-lut/src/../data/caffeine.json") }}
CANNABIS_DATA = {{ read_file("/home/josie/development/personal/josiedot/health/josie-health-lut/src/../data/cannabis.json") }}
COMBOS_DATA = {{ read_file("/home/josie/development/personal/josiedot/health/josie-health-lut/src/../data/combos.json") }}
DRUGS_DATA = {{ read_file("/home/josie/development/personal/josiedot/health/josie-health-lut/src/../data/drugs.json") }}

Embed data files at compile time

MEDS_DATA = {{ read_file("/home/josie/development/personal/josiedot/health/josie-health-lut/src/../data/meds.json") }}

Class Method Summary

Class Method Detail

def self.alcohol : JSON::Any #

Load and cache alcohol.json


def self.all_substances : Array(String) #

Get all substance names from drugs.json


def self.caffeine : JSON::Any #

Load and cache caffeine.json


def self.cannabis : JSON::Any #

Load and cache cannabis.json


def self.categories(name : String) : Array(String) #

Get categories for a substance


def self.combos : JSON::Any #

Load and cache combos.json


def self.drugs : JSON::Any #

Load and cache drugs.json


def self.interaction(substance1 : String, substance2 : String) : JSON::Any | Nil #

Get interaction info from combos.json


def self.meds : JSON::Any #

Load and cache meds.json


def self.pretty_name(name : String) : String | Nil #

Get pretty name for a substance


def self.substance_info(name : String) : JSON::Any | Nil #

Get substance info from drugs.json