Class: Jeeves::DefineImportedMethod

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

Instance Method Summary collapse

Instance Method Details

#call(target, internal_name, options) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/jeeves/define_imported_method.rb', line 3

def call(target, internal_name, options)
  @target = target
  @internal_name = internal_name
  @scope = options.fetch(:from)
  @external_name = options.fetch(:name)
  if options[:lazy] == true
    define_lazy
  elsif options[:lazy] == false
    define_non_lazy
  else
    define_smart
  end
  define_on_instance
end