Sha256: b56cdf989ad0ac5df5afe079ed3094e368ca43d1dd41636debccb13b30729d91

Contents?: true

Size: 1.53 KB

Versions: 8

Compression:

Stored size: 1.53 KB

Contents

module Yoda
  module Model
    module FunctionSignatures
      class Method < Base
        # @type Store::Objects::MethodObject
        attr_reader :method_object

        # @param method_object [Store::Objects::MethodObject]
        def initialize(method_object)
          fail ArgumentError, method_object unless method_object.is_a?(Store::Objects::MethodObject)
          @method_object = method_object
        end

        # @return [String]
        def name
          method_object.name.to_s
        end

        # @return [String]
        def sep
          method_object.sep
        end

        # @return [String]
        def namespace_path
          method_object.namespace_path
        end

        # @return [String]
        def document
          @method_object.document
        end

        # @return [Types::FunctionType]
        def type
          type_builder.type
        end

        # @return [Array<(String, Integer, Integer)>]
        def sources
          method_object.source
        end

        # @return [(String, Integer, Integer), nil]
        def primary_source
          method_object.primary_source
        end

        # @return [ParameterList]
        def parameters
          @parameters ||= ParameterList.new(method_object.parameters)
        end

        def parameter_type_of(param)
          type_builder.type_of(param)
        end

        private

        # @return [TypeBuilder]
        def type_builder
          @type_builder ||= TypeBuilder.new(parameters, method_object.tag_list)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
yoda-language-server-0.7.2 lib/yoda/model/function_signatures/method.rb
yoda-language-server-0.7.1 lib/yoda/model/function_signatures/method.rb
yoda-language-server-0.7.0 lib/yoda/model/function_signatures/method.rb
yoda-language-server-0.6.2 lib/yoda/model/function_signatures/method.rb
yoda-language-server-0.6.1 lib/yoda/model/function_signatures/method.rb
yoda-language-server-0.6.0 lib/yoda/model/function_signatures/method.rb
yoda-language-server-0.5.0 lib/yoda/model/function_signatures/method.rb
yoda-language-server-0.4.0 lib/yoda/model/function_signatures/method.rb