Class: Catfish::Dsl
- Inherits:
-
Object
- Object
- Catfish::Dsl
- Defined in:
- lib/catfish/dsl.rb
Instance Attribute Summary collapse
-
#servers ⇒ Object
Returns the value of attribute servers.
Class Method Summary collapse
Instance Method Summary collapse
- #eval_catfishfile ⇒ Object
-
#initialize ⇒ Dsl
constructor
A new instance of Dsl.
- #server(name, *_args) ⇒ Object
Constructor Details
#initialize ⇒ Dsl
Returns a new instance of Dsl.
10 11 12 |
# File 'lib/catfish/dsl.rb', line 10 def initialize @servers = [] end |
Instance Attribute Details
#servers ⇒ Object
Returns the value of attribute servers.
8 9 10 |
# File 'lib/catfish/dsl.rb', line 8 def servers @servers end |
Class Method Details
.evaluate ⇒ Object
3 4 5 6 |
# File 'lib/catfish/dsl.rb', line 3 def self.evaluate builder = new builder.eval_catfishfile end |
Instance Method Details
#eval_catfishfile ⇒ Object
14 15 16 17 18 |
# File 'lib/catfish/dsl.rb', line 14 def eval_catfishfile catfishfile = 'Catfishfile' contents = File.read(catfishfile).strip instance_eval(contents, catfishfile.to_s, 1) end |
#server(name, *_args) ⇒ Object
20 21 22 |
# File 'lib/catfish/dsl.rb', line 20 def server(name, *_args) servers << name end |