Class: Dependency::Transformer

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(parent, aspect, dependent, method_name) ⇒ Transformer

Returns a new instance of Transformer.



131
132
133
# File 'lib/dependency.rb', line 131

def initialize(parent, aspect, dependent, method_name)
  @parent, @aspect, @dependent, @method_name = parent, aspect, dependent, method_name
end

Instance Method Details

#for?(aspect, dependent) ⇒ Boolean

Returns:

  • (Boolean)


137
138
139
# File 'lib/dependency.rb', line 137

def for?(aspect, dependent)
  @aspect == aspect && @dependent.equal?(dependent)
end

#update(aspect = nil, message = {}) ⇒ Object



134
135
136
# File 'lib/dependency.rb', line 134

def update(aspect = nil, message = {})
  FlexiCaller.new(@method_name, message[:with], @parent).call_on(@dependent) if @aspect == aspect
end