Class: Seasar::Container::AspectDef

Inherits:
ArgDef
  • Object
show all
Defined in:
lib/seasar/container/aspect-def.rb

Instance Attribute Summary collapse

Attributes inherited from ArgDef

#child_component_def, #container, #expression, #value

Instance Method Summary collapse

Constructor Details

#initialize(pointcut, interceptor = nil, &procedure) ⇒ AspectDef

  • args

    1. Regexp pointcut

    2. Object interceptor

    3. Proc procedure



29
30
31
32
33
34
35
# File 'lib/seasar/container/aspect-def.rb', line 29

def initialize(pointcut, interceptor = nil, &procedure)
  if interceptor.nil? and procedure
     interceptor = procedure
  end
  super(interceptor)
  @pointcut = Seasar::Aop::Pointcut.new(pointcut)
end

Instance Attribute Details

#pointcutObject

Returns the value of attribute pointcut.



36
37
38
# File 'lib/seasar/container/aspect-def.rb', line 36

def pointcut
  @pointcut
end

Instance Method Details

#aspectObject

  • args

    • none

  • return

    • Seasar::Aop::Aspect



44
45
46
# File 'lib/seasar/container/aspect-def.rb', line 44

def aspect
  return Seasar::Aop::Aspect.new(self.value, self.pointcut)
end

#value=(interceptor) ⇒ Object

  • args

    1. Object interceptor

  • return

    • none

Raises:

  • (ArgumentError)


54
55
56
57
# File 'lib/seasar/container/aspect-def.rb', line 54

def value=(interceptor)
  raise ArgumentError.new("call method not defined on [#{interceptor} (#{interceptor.class})].") if not interceptor.class.method_defined?(:call)
  super
end