Class: Cow::Application::Cache
- Inherits:
-
Object
- Object
- Cow::Application::Cache
- Defined in:
- lib/cow/application.rb
Instance Attribute Summary collapse
-
#servers ⇒ Object
Returns the value of attribute servers.
Instance Method Summary collapse
- #add_server(_server) ⇒ Object
-
#initialize ⇒ Cache
constructor
A new instance of Cache.
Constructor Details
#initialize ⇒ Cache
Returns a new instance of Cache.
9 10 11 |
# File 'lib/cow/application.rb', line 9 def initialize @servers = [] end |
Instance Attribute Details
#servers ⇒ Object
Returns the value of attribute servers.
7 8 9 |
# File 'lib/cow/application.rb', line 7 def servers @servers end |
Instance Method Details
#add_server(_server) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cow/application.rb', line 13 def add_server(_server) @servers.each_with_index do |server, idx| if server.hostname == _server.hostname @servers[idx] = _server return _server end end @servers << _server end |