Class: Nyanko::Invoker::FunctionFinder
- Inherits:
-
Object
- Object
- Nyanko::Invoker::FunctionFinder
- Defined in:
- lib/nyanko/invoker/function_finder.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #active? ⇒ Boolean
- #find ⇒ Object
- #find_function ⇒ Object
-
#initialize(context, options) ⇒ FunctionFinder
constructor
A new instance of FunctionFinder.
- #scope ⇒ Object
- #unit ⇒ Object
Constructor Details
#initialize(context, options) ⇒ FunctionFinder
Returns a new instance of FunctionFinder.
12 13 14 15 |
# File 'lib/nyanko/invoker/function_finder.rb', line 12 def initialize(context, ) @context = context @options = end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
8 9 10 |
# File 'lib/nyanko/invoker/function_finder.rb', line 8 def context @context end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/nyanko/invoker/function_finder.rb', line 8 def @options end |
Class Method Details
.find(context, options) ⇒ Object
4 5 6 |
# File 'lib/nyanko/invoker/function_finder.rb', line 4 def self.find(context, ) new(context, ).find end |
Instance Method Details
#active? ⇒ Boolean
33 34 35 |
# File 'lib/nyanko/invoker/function_finder.rb', line 33 def active? unit.try(:active?, context, ) end |
#find ⇒ Object
17 18 19 |
# File 'lib/nyanko/invoker/function_finder.rb', line 17 def find active? && find_function end |
#find_function ⇒ Object
29 30 31 |
# File 'lib/nyanko/invoker/function_finder.rb', line 29 def find_function unit.find_function(scope, label) end |
#scope ⇒ Object
21 22 23 |
# File 'lib/nyanko/invoker/function_finder.rb', line 21 def scope as || context.class end |