Sha256: 5dacc0f80ce286f705cf6375ba2f74ba3757b012018b2ffd48ebacb4af93ebc7

Contents?: true

Size: 557 Bytes

Versions: 5

Compression:

Stored size: 557 Bytes

Contents

class YARD::Handlers::Ruby::Legacy::ClassVariableHandler < YARD::Handlers::Ruby::Legacy::Base
  HANDLER_MATCH = /\A@@\w+\s*=\s*/m
  handles HANDLER_MATCH
  
  process do
    # Don't document @@cvars 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.split(/\s*=\s*/, 2)
    register ClassVariableObject.new(namespace, name) do |o| 
      o.source = statement
      o.value = value.strip
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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