Class: Pot::Role
- Inherits:
-
Object
- Object
- Pot::Role
- Defined in:
- lib/pot/role.rb
Constant Summary collapse
- REGISTER =
{}
Instance Attribute Summary collapse
-
#instance ⇒ Object
readonly
Returns the value of attribute instance.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(role_name, instance_name) ⇒ Role
constructor
A new instance of Role.
Constructor Details
#initialize(role_name, instance_name) ⇒ Role
Returns a new instance of Role.
7 8 9 10 11 12 13 14 |
# File 'lib/pot/role.rb', line 7 def initialize(role_name, instance_name) @name = role_name instance = Pot::Instance::REGISTER[instance_name] raise "Undefined instance: #{instance_name}" unless instance @instance = instance REGISTER[role_name] = self end |
Instance Attribute Details
#instance ⇒ Object (readonly)
Returns the value of attribute instance.
5 6 7 |
# File 'lib/pot/role.rb', line 5 def instance @instance end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/pot/role.rb', line 5 def name @name end |