Class: CapUtil::ServerRoles::ServerDef
- Inherits:
-
Object
- Object
- CapUtil::ServerRoles::ServerDef
- Defined in:
- lib/cap-util/server_roles.rb
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(hostname, options_list = nil) ⇒ ServerDef
constructor
A new instance of ServerDef.
Constructor Details
#initialize(hostname, options_list = nil) ⇒ ServerDef
Returns a new instance of ServerDef.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/cap-util/server_roles.rb', line 64 def initialize(hostname, = nil) @hostname = hostname @options = {} # so, weird cap bug. options have to match type when using them in # a task's definition. so if you have (string) 'primary' option, you # have to use a string in your task defs. # this is not the case for the role names (string or symbol works). # so, I'm just defining each option, both in string (how it comes from # the configs) and symbol form. ( || []).each do |option| @options[option.to_s] = true @options[option.to_sym] = true end end |
Instance Attribute Details
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
62 63 64 |
# File 'lib/cap-util/server_roles.rb', line 62 def hostname @hostname end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
62 63 64 |
# File 'lib/cap-util/server_roles.rb', line 62 def @options end |