Class: Reflexive::MethodLookup

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

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ MethodLookup

Returns a new instance of MethodLookup.



5
6
7
8
9
10
# File 'lib/reflexive/method_lookup.rb', line 5

def initialize(options)
  unless (@klass, @level, @name = options.values_at(:klass, :level, :name)).all?
    raise ArgumentError, "must pass :klass, :level, :name as named arguments"
  end
  @level, @name = @level.to_sym, @name.to_sym
end

Instance Method Details

#definitionsObject



12
13
14
15
# File 'lib/reflexive/method_lookup.rb', line 12

def definitions
  lookup unless @lookup_done
  @definitions
end

#documentationsObject



17
18
19
20
# File 'lib/reflexive/method_lookup.rb', line 17

def documentations
  lookup unless @lookup_done
  @documentations
end

#last_resort_lookup_used?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/reflexive/method_lookup.rb', line 22

def last_resort_lookup_used?
  @last_resort_lookup_used
end