Class: RolePlaying::Role
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- RolePlaying::Role
- Defined in:
- lib/role_playing/role.rb
Class Method Summary collapse
Instance Method Summary collapse
- #class ⇒ Object
-
#role_player ⇒ Object
return the FINAL wrapped object.
Class Method Details
.played_by(object) ⇒ Object
7 8 9 10 |
# File 'lib/role_playing/role.rb', line 7 def played_by(object) role = new(object) block_given? ? yield(role) : role end |
Instance Method Details
#class ⇒ Object
13 14 15 |
# File 'lib/role_playing/role.rb', line 13 def class role_player.class ## this makes self.class return the extended objects class instead of DCIRole - should make the extension completely transparent end |
#role_player ⇒ Object
return the FINAL wrapped object
18 19 20 21 22 23 24 |
# File 'lib/role_playing/role.rb', line 18 def role_player player = self while player.respond_to?(:__getobj__) player = player.__getobj__ end player end |