Class: Backend
- Inherits:
-
Object
- Object
- Backend
- Defined in:
- lib/engine/app/lib/backend.rb
Instance Attribute Summary collapse
-
#current_database ⇒ Object
Returns the value of attribute current_database.
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Backend
constructor
A new instance of Backend.
- #redis ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Backend
Returns a new instance of Backend.
6 7 8 9 10 |
# File 'lib/engine/app/lib/backend.rb', line 6 def initialize(opts = {}) @host = opts[:host] @port = opts[:port] @current_database = opts[:current_database] end |
Instance Attribute Details
#current_database ⇒ Object
Returns the value of attribute current_database.
2 3 4 |
# File 'lib/engine/app/lib/backend.rb', line 2 def current_database @current_database end |
#host ⇒ Object
Returns the value of attribute host.
2 3 4 |
# File 'lib/engine/app/lib/backend.rb', line 2 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
2 3 4 |
# File 'lib/engine/app/lib/backend.rb', line 2 def port @port end |
Instance Method Details
#redis ⇒ Object
12 13 14 15 16 |
# File 'lib/engine/app/lib/backend.rb', line 12 def redis @redis ||= Redis.new(host: host, port: port) @redis.select(current_database) @redis end |