Sha256: 8c164e3ff3e6b1385c2ab247a4ab5876185cbec29368ecc3bfca51a4163aa4e9

Contents?: true

Size: 732 Bytes

Versions: 31

Compression:

Stored size: 732 Bytes

Contents

# Handles 'private', 'protected', and 'public' calls.
class YARD::Handlers::Ruby::VisibilityHandler < YARD::Handlers::Ruby::Base
  handles method_call(:private)
  handles method_call(:protected)
  handles method_call(:public)
  namespace_only

  process do
    return if (ident = statement.jump(:ident)) == statement
    case statement.type
    when :var_ref, :vcall
      self.visibility = ident.first
    when :fcall, :command
      statement[1].traverse do |node|
        case node.type
        when :symbol; source = node.first.source
        when :string_content; source = node.source
        else next
        end
        MethodObject.new(namespace, source, scope) {|o| o.visibility = ident.first }
      end
    end
  end
end

Version data entries

31 entries across 28 versions & 3 rubygems

Version Path
challah-0.6.2 vendor/bundle/gems/yard-0.8.1/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.6.2 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.6.1 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.6.1 vendor/bundle/gems/yard-0.8.1/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.6.0 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.6.0 vendor/bundle/gems/yard-0.8.1/lib/yard/handlers/ruby/visibility_handler.rb
yard-0.8.1 lib/yard/handlers/ruby/visibility_handler.rb
yard-0.8.0 lib/yard/handlers/ruby/visibility_handler.rb
challah-0.5.4 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.5.3 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.5.2 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.5.1 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.5.0 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.4.1 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.4.0 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.3.5 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.3.4 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.3.3 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.3.2 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb
challah-0.3.1 vendor/bundle/gems/yard-0.7.5/lib/yard/handlers/ruby/visibility_handler.rb