class Yoda::Model::Types::GenericType

Attributes

base_type[R]

@return [Base]

type_arguments[R]

@return [Array<Base>]

Public Class Methods

from_key_value(base_type, key_type, value_type) click to toggle source

@param base_type [Base] @param key_type [Base] @param value_type [Base]

# File lib/yoda/model/types/generic_type.rb, line 14
def self.from_key_value(base_type, key_type, value_type)
  new(base_type, [key_type, value_type])
end
new(base_type, type_arguments) click to toggle source

@param base_type [Types::Base] @param type_arguments [Array<Base>]

# File lib/yoda/model/types/generic_type.rb, line 26
def initialize(base_type, type_arguments)
  @base_type = base_type
  @type_arguments = type_arguments
end

Public Instance Methods

change_root(paths) click to toggle source

@param paths [Array<Path>] @return [self]

# File lib/yoda/model/types/generic_type.rb, line 20
def change_root(paths)
  self.class.new(base_type.change_root(paths), type_arguments.map { |type| type.change_root(paths) })
end
eql?(another) click to toggle source

@param another [Object]

# File lib/yoda/model/types/generic_type.rb, line 32
def eql?(another)
  another.is_a?(GenericType) &&
  base_type  == another.base_type &&
  type_arguments == another.type_arguments
end
hash() click to toggle source
# File lib/yoda/model/types/generic_type.rb, line 38
def hash
  [self.class.name, base_type, type_arguments].hash
end
map(&block) click to toggle source

@return [self]

# File lib/yoda/model/types/generic_type.rb, line 60
def map(&block)
  self.class.new(base_type.map(&block), type_arguments.map(&block))
end
resolve(registry) click to toggle source

@param registry [Registry] @return [Array<YARD::CodeObjects::Base, YARD::CodeObjects::Proxy>]

# File lib/yoda/model/types/generic_type.rb, line 50
def resolve(registry)
  base_type.resolve(registry)
end
to_s() click to toggle source

@return [String]

# File lib/yoda/model/types/generic_type.rb, line 55
def to_s
  "#{base_type}<#{type_arguments.map(&:to_s).join(', ')}>"
end