Sha256: 531b07ad7d18c9f874833a76e3c9f0796fafe93c7d7508fb55c6b55f6530ad59

Contents?: true

Size: 840 Bytes

Versions: 2

Compression:

Stored size: 840 Bytes

Contents

require 'yard'

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

          handles /\Aparameter\s/

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

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

              register MethodObject.new(nobj, "#{name}=", mscope) do |o|
                o.visibility = :public
                o.source = statement.source
                o.signature = "def #{name}=(value)"
                o.parameters = [['value', nil]]
              end
            end

        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
parameters-0.1.9 lib/parameters/yard/handlers/ruby/legacy/parameter_handler.rb
parameters-0.1.8 lib/parameters/yard/handlers/ruby/legacy/parameter_handler.rb