Class/Module Index [+]

Quicksearch

YARD::Handlers::C::HandlerMethods

Public Instance Methods

handle_alias(var_name, new_name, old_name) click to toggle source
# File lib/yard/handlers/c/handler_methods.rb, line 62
def handle_alias(var_name, new_name, old_name)
  namespace = namespace_for_variable(var_name)
  return if namespace.nil?
  new_meth, old_meth = new_name.to_sym, old_name.to_sym
  old_obj = namespace.child(:name => old_meth, :scope => :instance)
  new_obj = register MethodObject.new(namespace, new_meth, :instance) do |o|
    register_visibility(o, visibility)
    register_file_info(o, statement.file, statement.line)
  end

  if old_obj
    new_obj.signature = old_obj.signature
    new_obj.source = old_obj.source
    new_obj.docstring = old_obj.docstring
    new_obj.docstring.object = new_obj
  else
    new_obj.signature = "def #{new_meth}" # this is all we know.
  end

  namespace.aliases[new_obj] = old_meth
end
handle_attribute(var_name, name, read, write) click to toggle source
# File lib/yard/handlers/c/handler_methods.rb, line 52
def handle_attribute(var_name, name, read, write)
  values = {:read => read.to_i, :write => write.to_i}
  {:read => name, :write => "#{name}="}.each do |type, meth_name|
    next unless values[type] > 0
    obj = handle_method(:instance, var_name, meth_name, nil)
    obj.namespace.attributes[:instance][name] ||= SymbolHash[:read => nil, :write => nil]
    obj.namespace.attributes[:instance][name][type] = obj
  end
end
handle_class(var_name, class_name, parent, in_module = nil) click to toggle source
# File lib/yard/handlers/c/handler_methods.rb, line 8
def handle_class(var_name, class_name, parent, in_module = nil)
  parent = nil if parent == "0"
  namespace = in_module ? namespace_for_variable(in_module) : Registry.root
  register ClassObject.new(namespace, class_name) do |obj|
    if parent
      parent_class = namespace_for_variable(parent)
      if parent_class.is_a?(Proxy)
        obj.superclass = "::#{parent_class.path}"
        obj.superclass.type = :class
      else
        obj.superclass = parent_class
      end
    end
    namespaces[var_name] = obj
    register_file_info(obj, statement.file, statement.line)
  end
end
handle_constants(type, var_name, const_name, value) click to toggle source
# File lib/yard/handlers/c/handler_methods.rb, line 84
def handle_constants(type, var_name, const_name, value)
  return unless type == 'const'
  namespace = namespace_for_variable(var_name)
  register ConstantObject.new(namespace, const_name) do |obj|
    obj.source_type = :c
    obj.value = value
    register_file_info(obj, statement.file, statement.line)
    find_constant_docstring(obj)
  end
end
handle_method(scope, var_name, name, func_name, source_file = nil) click to toggle source
# File lib/yard/handlers/c/handler_methods.rb, line 34
def handle_method(scope, var_name, name, func_name, source_file = nil)
  visibility = :public
  case scope
  when "singleton_method"; scope = :class
  when "module_function"; scope = :module
  when "private_method"; scope = :instance; visibility = :private
  else; scope = :instance
  end

  namespace = namespace_for_variable(var_name)
  return if namespace.nil? # XXX: raise UndocumentableError might be too noisy.
  register MethodObject.new(namespace, name, scope) do |obj|
    register_visibility(obj, visibility)
    find_method_body(obj, func_name)
    obj.docstring.add_tag(Tags::Tag.new(:return, '', 'Boolean')) if name =~ /\?$/
  end
end
handle_module(var_name, module_name, in_module = nil) click to toggle source
# File lib/yard/handlers/c/handler_methods.rb, line 26
def handle_module(var_name, module_name, in_module = nil)
  namespace = in_module ? namespace_for_variable(in_module) : Registry.root
  register ModuleObject.new(namespace, module_name) do |obj|
    namespaces[var_name] = obj
    register_file_info(obj, statement.file, statement.line)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.