Class: Juden::Config
Overview
read keymap from yaml file
Instance Attribute Summary collapse
-
#custom_path ⇒ Object
Returns the value of attribute custom_path.
-
#keymap ⇒ Object
readonly
Returns the value of attribute keymap.
Instance Method Summary collapse
- #device_name ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #interval_seconds ⇒ Object
- #reload ⇒ Object
- #threshold_percentage ⇒ Object
- #webhook_url ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
11 12 13 14 |
# File 'lib/juden/config.rb', line 11 def initialize @custom_path = nil reload end |
Instance Attribute Details
#custom_path ⇒ Object
Returns the value of attribute custom_path.
9 10 11 |
# File 'lib/juden/config.rb', line 9 def custom_path @custom_path end |
#keymap ⇒ Object (readonly)
Returns the value of attribute keymap.
8 9 10 |
# File 'lib/juden/config.rb', line 8 def keymap @keymap end |
Instance Method Details
#device_name ⇒ Object
34 35 36 |
# File 'lib/juden/config.rb', line 34 def device_name keymap['device_name'] end |
#interval_seconds ⇒ Object
26 27 28 |
# File 'lib/juden/config.rb', line 26 def interval_seconds keymap['interval_seconds'] end |
#reload ⇒ Object
16 17 18 19 20 |
# File 'lib/juden/config.rb', line 16 def reload @cache = nil @keymap = YAML.load_file(file_path) self end |
#threshold_percentage ⇒ Object
22 23 24 |
# File 'lib/juden/config.rb', line 22 def threshold_percentage keymap['threshold_percentage'] end |
#webhook_url ⇒ Object
30 31 32 |
# File 'lib/juden/config.rb', line 30 def webhook_url keymap['webhook_url'] end |