Class: FakeConsul::Server
- Inherits:
-
HashWithIndifferentAccess
- Object
- HashWithIndifferentAccess
- FakeConsul::Server
- Defined in:
- lib/fake_consul/server.rb
Instance Method Summary collapse
-
#get(key, options = nil, not_found = :reject, found = :return) ⇒ Array<Hash>
Fake get.
-
#put(key, value, options = nil) ⇒ Boolean
Fake put.
Instance Method Details
#get(key, options = nil, not_found = :reject, found = :return) ⇒ Array<Hash>
Fake get
Performs no http requests but stores data in local hash
14 15 16 17 18 19 20 21 22 |
# File 'lib/fake_consul/server.rb', line 14 def get(key, = nil, not_found = :reject, found = :return) ||= {} if [:recurse] find_keys_recursive(key) else consul_export_format(key) end end |
#put(key, value, options = nil) ⇒ Boolean
Fake put
Performs no http requests but retrieves data from local hash
31 32 33 34 35 |
# File 'lib/fake_consul/server.rb', line 31 def put(key, value, = nil) self[key] = value compact true end |