class Pavlov::OperationFinder

Attributes

namespace[R]

Public Class Methods

find(namespace, operation_name) click to toggle source
# File lib/pavlov/operation_finder.rb, line 7
def self.find(namespace, operation_name)
  operation_lookup_list = Inflector.camelize(operation_name.to_s).split('::')
  operation_lookup_list.reduce(namespace) do |current_namespace, namespace_or_operation_name|
    new(current_namespace).send(namespace_or_operation_name)
  end
end
new(namespace) click to toggle source
# File lib/pavlov/operation_finder.rb, line 14
def initialize(namespace)
  @namespace = namespace
end

Public Instance Methods

method_missing(name, attributes = {}) click to toggle source
# File lib/pavlov/operation_finder.rb, line 18
def method_missing(name, attributes = {})
  find_klass(name)
end
respond_to_missing?(name, include_private = false) click to toggle source
# File lib/pavlov/operation_finder.rb, line 22
def respond_to_missing?(name, include_private = false)
  find_klass(name)
end

Private Instance Methods

find_klass(name) click to toggle source
# File lib/pavlov/operation_finder.rb, line 28
def find_klass(name)
  namespace.const_get(Inflector.camelize(name.to_s), false)
end