Class: NestConnect::ConfigStore

Inherits:
Object
  • Object
show all
Defined in:
lib/nest_connect/config_store.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ ConfigStore

Returns a new instance of ConfigStore.



6
7
8
# File 'lib/nest_connect/config_store.rb', line 6

def initialize(path)
  @path = path
end

Instance Method Details

#[](key) ⇒ Object



10
11
12
# File 'lib/nest_connect/config_store.rb', line 10

def [](key)
  data[key]
end

#save(key, value) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/nest_connect/config_store.rb', line 14

def save(key, value)
  data[key] = value

  find_or_create_directory
  find_or_create_file
  persist_data

  value
end