Sha256: 3e5eb8c8f2693bc2fa033a2105fdcee3f02f2c05c4269b8648b6a96094986551

Contents?: true

Size: 526 Bytes

Versions: 2

Compression:

Stored size: 526 Bytes

Contents

require 'yard'

module YARD
  module Handlers
    module Ruby
      module Legacy
        class PredefineHandler < Base

          handles /\Apredefine\s/

          def process
            nobj = namespace
            name = statement.tokens[2,1].to_s[1..-1]

            register MethodObject.new(nobj, name, :class) do |o|
              o.visibility = :public
              o.source = statement.source
              o.signature = "def #{nobj}.#{name}"
            end
          end

        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dm-predefined-0.2.1 lib/dm-predefined/yard/handlers/ruby/legacy/predefine_handler.rb
dm-predefined-0.2.0 lib/dm-predefined/yard/handlers/ruby/legacy/predefine_handler.rb