Class: CapUtil::ServerRoles::RoleSet

Inherits:
Object
  • Object
show all
Defined in:
lib/cap-util/server_roles.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(roles_hash) ⇒ RoleSet

Returns a new instance of RoleSet.



29
30
31
32
33
# File 'lib/cap-util/server_roles.rb', line 29

def initialize(roles_hash)
  @role_defs = roles_hash.map do |(role_name, role_servers_hash)|
    RoleDef.new(role_name, role_servers_hash)
  end
end

Instance Attribute Details

#role_defsObject (readonly)

Returns the value of attribute role_defs.



27
28
29
# File 'lib/cap-util/server_roles.rb', line 27

def role_defs
  @role_defs
end

Instance Method Details

#each(&block) ⇒ Object



35
36
37
# File 'lib/cap-util/server_roles.rb', line 35

def each(&block)
  @role_defs.each {|role_def| role_def.apply(&block)}
end