Class: Smith::AgentConfig
- Inherits:
-
Object
- Object
- Smith::AgentConfig
- Defined in:
- lib/smith/agent_config.rb
Instance Method Summary collapse
- #for(agent) ⇒ Object
-
#initialize(path, name) ⇒ AgentConfig
constructor
A new instance of AgentConfig.
- #update(agent, value) ⇒ Object
Constructor Details
#initialize(path, name) ⇒ AgentConfig
Returns a new instance of AgentConfig.
9 10 11 12 |
# File 'lib/smith/agent_config.rb', line 9 def initialize(path, name) @path = Pathname.new(path) @db ||= LevelDB::DB.new(@path.join(name).to_s) end |
Instance Method Details
#for(agent) ⇒ Object
14 15 16 |
# File 'lib/smith/agent_config.rb', line 14 def for(agent) @db[agent] end |
#update(agent, value) ⇒ Object
18 19 20 |
# File 'lib/smith/agent_config.rb', line 18 def update(agent, value) @db[agent] = value end |