Class: Kiseru::Config
- Inherits:
-
Object
- Object
- Kiseru::Config
- Defined in:
- lib/ki_middleman/kiseru.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(root_path, app_name) ⇒ Config
constructor
A new instance of Config.
- #read(key) ⇒ Object
- #write(key, time) ⇒ Object
Constructor Details
#initialize(root_path, app_name) ⇒ Config
Returns a new instance of Config.
35 36 37 38 |
# File 'lib/ki_middleman/kiseru.rb', line 35 def initialize(root_path, app_name) file_path = (root_path + "#{app_name}.yml").to_s @store = YAML::Store.new(file_path) end |
Class Method Details
Instance Method Details
#read(key) ⇒ Object
46 47 48 49 50 |
# File 'lib/ki_middleman/kiseru.rb', line 46 def read(key) @store.transaction(read_only=true) do @store[key] end end |
#write(key, time) ⇒ Object
40 41 42 43 44 |
# File 'lib/ki_middleman/kiseru.rb', line 40 def write(key, time) @store.transaction do @store[key] = time end end |