Class: Muck::ConfigDSL::ServerDSL
- Inherits:
-
Object
- Object
- Muck::ConfigDSL::ServerDSL
- Defined in:
- lib/muck/config_dsl/server_dsl.rb
Instance Method Summary collapse
- #database(&block) ⇒ Object
- #frequency(frequency) ⇒ Object
- #hostname(hostname) ⇒ Object
-
#initialize(hash) ⇒ ServerDSL
constructor
A new instance of ServerDSL.
- #retention(&block) ⇒ Object
- #ssh(&block) ⇒ Object
- #storage(&block) ⇒ Object
Constructor Details
#initialize(hash) ⇒ ServerDSL
10 11 12 |
# File 'lib/muck/config_dsl/server_dsl.rb', line 10 def initialize(hash) @hash = hash end |
Instance Method Details
#database(&block) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/muck/config_dsl/server_dsl.rb', line 37 def database(&block) hash = {} dsl = DatabaseDSL.new(hash) dsl.instance_eval(&block) @hash[:databases] ||= [] @hash[:databases] << hash end |
#frequency(frequency) ⇒ Object
18 19 20 |
# File 'lib/muck/config_dsl/server_dsl.rb', line 18 def frequency(frequency) @hash[:frequency] = frequency end |
#hostname(hostname) ⇒ Object
14 15 16 |
# File 'lib/muck/config_dsl/server_dsl.rb', line 14 def hostname(hostname) @hash[:hostname] = hostname end |
#retention(&block) ⇒ Object
32 33 34 35 |
# File 'lib/muck/config_dsl/server_dsl.rb', line 32 def retention(&block) dsl = RetentionDSL.new(@hash[:retention] = Hash.new) dsl.instance_eval(&block) end |
#ssh(&block) ⇒ Object
22 23 24 25 |
# File 'lib/muck/config_dsl/server_dsl.rb', line 22 def ssh(&block) dsl = SSHDSL.new(@hash[:ssh] = Hash.new) dsl.instance_eval(&block) end |
#storage(&block) ⇒ Object
27 28 29 30 |
# File 'lib/muck/config_dsl/server_dsl.rb', line 27 def storage(&block) dsl = StorageDSL.new(@hash[:storage] = Hash.new) dsl.instance_eval(&block) end |