Class: Teleport::Config::Role
- Inherits:
-
Object
- Object
- Teleport::Config::Role
- Defined in:
- lib/teleport/config.rb
Overview
The model for role 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) ⇒ Role
constructor
A new instance of Role.
Constructor Details
#initialize(name, options) ⇒ Role
Returns a new instance of Role.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/teleport/config.rb', line 50 def initialize(name, ) raise "role name must be a sym" if !name.is_a?(Symbol) raise "role options must be a hash" if !.is_a?(Hash) @name, @options, @packages, @recipes = name, , [], [] # Packages if p = @options.delete(:packages) raise "role :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.
48 49 50 |
# File 'lib/teleport/config.rb', line 48 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
48 49 50 |
# File 'lib/teleport/config.rb', line 48 def @options end |
#packages ⇒ Object (readonly)
Returns the value of attribute packages.
48 49 50 |
# File 'lib/teleport/config.rb', line 48 def packages @packages end |
#recipes ⇒ Object (readonly)
Returns the value of attribute recipes.
48 49 50 |
# File 'lib/teleport/config.rb', line 48 def recipes @recipes end |