Sha256: 6d1f2034762176d9ccddab19b396ade4d98acd256e2a946d2ac6dbf5b5b1e132

Contents?: true

Size: 664 Bytes

Versions: 11

Compression:

Stored size: 664 Bytes

Contents

class YARD::Handlers::Ruby::MixinHandler < YARD::Handlers::Ruby::Base
  namespace_only
  handles method_call(:include)
  
  def process
    statement.parameters(false).each {|mixin| process_mixin(mixin) }
  end

  protected

  def process_mixin(mixin)
    unless mixin.ref?
      raise YARD::Parser::UndocumentableError, "mixin #{mixin.source} for class #{namespace.path}"
    end
    
    case obj = Proxy.new(namespace, mixin.source)
    when Proxy
      obj.type = :module
    when ConstantObject # If a constant is included, use its value as the real object
      obj = Proxy.new(namespace, obj.value)
    end
    
    namespace.mixins(scope) << obj
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
yard-0.5.3 lib/yard/handlers/ruby/mixin_handler.rb
yard-0.5.2 lib/yard/handlers/ruby/mixin_handler.rb
yard-0.5.1p1 lib/yard/handlers/ruby/mixin_handler.rb
yard-0.5.1 lib/yard/handlers/ruby/mixin_handler.rb
yard-0.5.0 lib/yard/handlers/ruby/mixin_handler.rb
yard-0.4.0 lib/yard/handlers/ruby/mixin_handler.rb
yard-0.2.3.5 lib/yard/handlers/ruby/mixin_handler.rb
yard-0.2.3.4 lib/yard/handlers/ruby/mixin_handler.rb
yard-0.2.3.2 lib/yard/handlers/ruby/mixin_handler.rb
yard-0.2.3.3 lib/yard/handlers/ruby/mixin_handler.rb
yard-0.2.3 lib/yard/handlers/ruby/mixin_handler.rb