Class: Odania::Config::BackendGroup
- Inherits:
-
Object
- Object
- Odania::Config::BackendGroup
- Defined in:
- lib/odania/config/backend_group.rb
Instance Attribute Summary collapse
-
#backends ⇒ Object
Returns the value of attribute backends.
-
#core_backend ⇒ Object
Returns the value of attribute core_backend.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #add_backend(backend) ⇒ Object
- #check_core_backend(tags) ⇒ Object
- #dump ⇒ Object
-
#initialize(name, backends = []) ⇒ BackendGroup
constructor
A new instance of BackendGroup.
- #load(data) ⇒ Object
Constructor Details
#initialize(name, backends = []) ⇒ BackendGroup
Returns a new instance of BackendGroup.
6 7 8 9 10 |
# File 'lib/odania/config/backend_group.rb', line 6 def initialize(name, backends=[]) self.name = name self.core_backend = false self.backends = backends end |
Instance Attribute Details
#backends ⇒ Object
Returns the value of attribute backends.
4 5 6 |
# File 'lib/odania/config/backend_group.rb', line 4 def backends @backends end |
#core_backend ⇒ Object
Returns the value of attribute core_backend.
4 5 6 |
# File 'lib/odania/config/backend_group.rb', line 4 def core_backend @core_backend end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/odania/config/backend_group.rb', line 4 def name @name end |
Instance Method Details
#add_backend(backend) ⇒ Object
12 13 14 |
# File 'lib/odania/config/backend_group.rb', line 12 def add_backend(backend) self.backends << backend end |
#check_core_backend(tags) ⇒ Object
16 17 18 |
# File 'lib/odania/config/backend_group.rb', line 16 def check_core_backend() self.core_backend = .include?('core-backend') end |
#dump ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/odania/config/backend_group.rb', line 20 def dump backend_data = [] backends.each do |backend| backend_data << backend.dump end { 'name' => name, 'backends' => backend_data } end |