Sha256: 90c0ad6b510355d064c575b1944d3ea17df75ad3fe416fbf5c23b78993d2744d

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

module Inch
  module CodeObject
    # CodeObject::Proxy object represent code objects in the analaysed
    # codebase.
    #
    module Proxy
      class << self
        # Returns a Proxy object for the given +code_object+
        #
        # @param code_object [YARD::Object::Base]
        # @return [CodeObject::Proxy::Base]
        def for(code_object)
          attributes = Converter.to_hash(code_object)
          class_for(code_object).new(attributes)
        end

        private

        # Returns a Proxy class for the given +code_object+
        #
        # @param code_object [YARD::CodeObject]
        # @return [Class]
        def class_for(code_object)
          class_name = code_object.class.to_s.split("::").last
          const_get(class_name)
        end
      end
    end
  end
end

require "inch/code_object/proxy/base"
require "inch/code_object/proxy/namespace_object"
require "inch/code_object/proxy/class_object"
require "inch/code_object/proxy/class_variable_object"
require "inch/code_object/proxy/constant_object"
require "inch/code_object/proxy/method_object"
require "inch/code_object/proxy/method_parameter_object"
require "inch/code_object/proxy/module_object"

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
inch-0.4.10 lib/inch/code_object/proxy.rb
inch-0.4.9 lib/inch/code_object/proxy.rb
inch-0.4.8 lib/inch/code_object/proxy.rb
inch-0.4.7 lib/inch/code_object/proxy.rb