Sha256: 4752067dfba61737f3684caee1fb3059840e37b2087c552ef2803454ae7561c4
Contents?: true
Size: 1.24 KB
Versions: 8
Compression:
Stored size: 1.24 KB
Contents
module Yoda module Model module Types class SequenceType < Base attr_reader :base_type, :types # @param base_type [Base] # @param types [Array<Base>] def initialize(base_type, types) @base_type = base_type @types = types end def name base_type.name end # @param another [Object] def eql?(another) another.is_a?(SequenceType) && base_type == another.base_type && types == another.types end def hash [self.class.name, base_type, types].hash end # @param paths [Array<Path>] # @return [self] def change_root(paths) self.class.new(base_type.change_root(paths), types.map { |type| type.change_root(paths) }) end # @param registry [Registry] # @return [Array<Store::Objects::Base>] def resolve(registry) base_type.resolve(registry) end # @return [String] def to_s "#{base_type}(#{types.map(&:to_s).join(', ')})" end # @return [self] def map(&block) self.class.new(base_type.map(&block), types.map(&block)) end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems