Sha256: 87b455496fdab319c2dc184396247d06f8005327f418d9532dc011ac4f7912bb

Contents?: true

Size: 504 Bytes

Versions: 1

Compression:

Stored size: 504 Bytes

Contents

class YARD::Handlers::ConstantHandler < YARD::Handlers::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 }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yard-0.2.2 lib/yard/handlers/constant_handler.rb