Sha256: f1c4f174fb35a8e3cc0800ca36302b979e6e14e3f9967b98658fd0edb5e9e161

Contents?: true

Size: 555 Bytes

Versions: 5

Compression:

Stored size: 555 Bytes

Contents

class YARD::Handlers::Ruby::Legacy::ConstantHandler < YARD::Handlers::Ruby::Legacy::Base
  HANDLER_MATCH = /\A[A-Z]\w*\s*=[^=]\s*/m
  handles HANDLER_MATCH
  
  def process
    # Don't document CONSTANTS if they're set in second class objects (methods) because
    # they're not "static" when executed from a method
    return unless owner.is_a? NamespaceObject
    
    name, value = *statement.tokens.to_s.gsub(/\r?\n/, '').split(/\s*=\s*/, 2)
    register ConstantObject.new(namespace, name) {|o| o.source = statement; o.value = value.strip }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yard-0.2.3.5 lib/yard/handlers/ruby/legacy/constant_handler.rb
yard-0.2.3.4 lib/yard/handlers/ruby/legacy/constant_handler.rb
yard-0.2.3.2 lib/yard/handlers/ruby/legacy/constant_handler.rb
yard-0.2.3.3 lib/yard/handlers/ruby/legacy/constant_handler.rb
yard-0.2.3 lib/yard/handlers/ruby/legacy/constant_handler.rb