Class: Pot::Role

Inherits:
Object
  • Object
show all
Defined in:
lib/pot/role.rb

Constant Summary collapse

REGISTER =
{}

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#instanceObject (readonly)

Returns the value of attribute instance.



5
6
7
# File 'lib/pot/role.rb', line 5

def instance
  @instance
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/pot/role.rb', line 5

def name
  @name
end