Class: Teleport::Config::Server
- Inherits:
-
Object
- Object
- Teleport::Config::Server
- Defined in:
- lib/teleport/config.rb
Overview
The model for server in the Telfile.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#packages ⇒ Object
readonly
Returns the value of attribute packages.
-
#recipes ⇒ Object
readonly
Returns the value of attribute recipes.
Instance Method Summary collapse
-
#initialize(name, options) ⇒ Server
constructor
A new instance of Server.
Constructor Details
#initialize(name, options) ⇒ Server
Returns a new instance of Server.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/teleport/config.rb', line 74 def initialize(name, ) raise "server name must be a string" if !name.is_a?(String) raise "server options must be a hash" if !.is_a?(Hash) raise "server :role must be a sym" if [:role] && ![:role].is_a?(Symbol) @name, @options, @packages, @recipes = name, , [], [] # Packages if p = @options.delete(:packages) raise "server :packages must be an array" if !p.is_a?(Array) @packages = p end # Recipes if r = @options.delete(:recipes) raise "server :recipes must be an array" if !r.is_a?(Array) @recipes = r end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
72 73 74 |
# File 'lib/teleport/config.rb', line 72 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
72 73 74 |
# File 'lib/teleport/config.rb', line 72 def @options end |
#packages ⇒ Object (readonly)
Returns the value of attribute packages.
72 73 74 |
# File 'lib/teleport/config.rb', line 72 def packages @packages end |
#recipes ⇒ Object (readonly)
Returns the value of attribute recipes.
72 73 74 |
# File 'lib/teleport/config.rb', line 72 def recipes @recipes end |