module DCI::Role

Private Instance Methods

add_role_reader_for!(rolekey) click to toggle source

Defines a new private reader instance method for a context mate role, delegating it to the context object.

# File lib/drsi/dci/role.rb, line 11
def add_role_reader_for!(rolekey)
  return if private_method_defined?(rolekey)
  define_method(rolekey) {__context.send(rolekey)}
  private rolekey
end
context() click to toggle source
# File lib/drsi/dci/role.rb, line 6
def context
  raise 'This method must be redefined in every module extending DCI::Role'
end