Sha256: 0fe4f2f3d0604ef3a5b9558f56bfa7e33aebe29002e84dc0686f92e0282b1510

Contents?: true

Size: 724 Bytes

Versions: 4

Compression:

Stored size: 724 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
      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

4 entries across 4 versions & 2 rubygems

Version Path
vanity-1.7.1 vendor/ruby/1.9.1/gems/yard-0.7.2/lib/yard/handlers/ruby/visibility_handler.rb
yard-0.7.2 lib/yard/handlers/ruby/visibility_handler.rb
yard-0.7.1 lib/yard/handlers/ruby/visibility_handler.rb
yard-0.7.0 lib/yard/handlers/ruby/visibility_handler.rb