Sha256: 2a49a9e5ea6d9544f679dbc8798ba999a3d20a9564b954bc1b4fd0e8313d3eab

Contents?: true

Size: 579 Bytes

Versions: 5

Compression:

Stored size: 579 Bytes

Contents

class YARD::Handlers::Ruby::VisibilityHandler < YARD::Handlers::Ruby::Base
  handles method_call(:private)
  handles method_call(:protected)
  handles method_call(:public)
  
  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|
        next unless node.type == :ident || node.type == :string_content
        MethodObject.new(namespace, node.source, scope) {|o| o.visibility = ident.first }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yard-0.5.8 lib/yard/handlers/ruby/visibility_handler.rb
yard-0.5.7 lib/yard/handlers/ruby/visibility_handler.rb
yard-0.5.6 lib/yard/handlers/ruby/visibility_handler.rb
yard-0.5.5 lib/yard/handlers/ruby/visibility_handler.rb
yard-0.5.4 lib/yard/handlers/ruby/visibility_handler.rb