lib/coactive/lookups/name.rb in coactive-0.3.0 vs lib/coactive/lookups/name.rb in coactive-0.4.0
- old
+ new
@@ -9,17 +9,14 @@
end
private
def load_files
- Coactive::Loader.call(@klass.coactive_config.load_paths)
+ Coactive::Loader.call(@config.load_paths)
end
def lookup
- @klass.coactive_config.base_class.descendants.each_with_object({}).with_index do |(coactor, hash), i|
- coaction = coactor.coactions.detect { |coaction| coaction.name == @coactant }
- hash[[coaction.priority || 1 << 63, i]] = coactor if coaction
- end.sort.map { |x| x[1] }
+ @config.base_class.coactions_map[@coactant].to_a.map(&:coactor)
end
class << self
def callable?(coactant)
coactant.is_a?(Symbol)