Sha256: 9238ea0b60a8e5123c7e40b675a75f6f61cba9a2f21463c84481702cb567174c

Contents?: true

Size: 580 Bytes

Versions: 11

Compression:

Stored size: 580 Bytes

Contents

class YARD::Handlers::Ruby::VisibilityHandler < YARD::Handlers::Ruby::Base
  handles method_call(:private)
  handles method_call(:protected)
  handles method_call(:public)
  
  def process
    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

11 entries across 11 versions & 1 rubygems

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