Class: Maestro::Role
Overview
A role that a Node in a Cloud can play
Instance Attribute Summary collapse
-
#cloud ⇒ Object
readonly
the Cloud this Role belongs to.
-
#name ⇒ Object
readonly
the name of this Role.
Attributes included from Validator
Instance Method Summary collapse
-
#initialize(name, cloud, &block) ⇒ Role
constructor
A new instance of Role.
Methods included from Validator
#invalidate, #valid?, #validate
Constructor Details
#initialize(name, cloud, &block) ⇒ Role
Returns a new instance of Role.
14 15 16 17 18 19 20 |
# File 'lib/maestro/role.rb', line 14 def initialize(name, cloud, &block) super() raise StandardError, "Role name cannot contain spaces: #{name}" if name.is_a?(String) && !name.index(/\s/).nil? @name = name @cloud = cloud instance_eval(&block) if block_given? end |
Instance Attribute Details
#cloud ⇒ Object (readonly)
the Cloud this Role belongs to
11 12 13 |
# File 'lib/maestro/role.rb', line 11 def cloud @cloud end |
#name ⇒ Object (readonly)
the name of this Role
9 10 11 |
# File 'lib/maestro/role.rb', line 9 def name @name end |