class Steep::Interface::Builder::Config
def ==(other)
def ==(other) other.is_a?(Config) && other.self_type == self_type && other.class_type == class_type && other.instance_type == instance_type && other.resolve_self == resolve_self && other.resolve_class == resolve_class && other.resolve_instance == resolve_instance && other.variable_bounds == variable_bounds end
def hash
def hash self_type.hash ^ class_type.hash ^ instance_type.hash ^ resolve_self.hash ^ resolve_class.hash ^ resolve_instance.hash ^ variable_bounds.hash end
def initialize(self_type:, class_type:, instance_type:, resolve_self: true, resolve_class: true, resolve_instance: true, variable_bounds:)
def initialize(self_type:, class_type:, instance_type:, resolve_self: true, resolve_class: true, resolve_instance: true, variable_bounds:) @self_type = self_type @class_type = class_type @instance_type = instance_type @resolve_self = resolve_self @resolve_class = resolve_class @resolve_instance = resolve_instance @variable_bounds = variable_bounds end
def no_resolve
def no_resolve if resolve? @no_resolve ||= update(resolve_self: false, resolve_class: false, resolve_instance: false) else self end end
def resolve?
def resolve? resolve_self || resolve_class || resolve_instance end
def subst
def subst @subst ||= begin Substitution.build( [], [], self_type: self_type, module_type: class_type || AST::Types::Class.instance, instance_type: instance_type || AST::Types::Instance.instance ) end end
def update(self_type: self.self_type, class_type: self.class_type, instance_type: self.instance_type, resolve_self: self.resolve_self, resolve_class: self.resolve_class, resolve_instance: self.resolve_instance, variable_bounds: self.variable_bounds)
def update(self_type: self.self_type, class_type: self.class_type, instance_type: self.instance_type, resolve_self: self.resolve_self, resolve_class: self.resolve_class, resolve_instance: self.resolve_instance, variable_bounds: self.variable_bounds) _ = self.class.new( self_type: self_type, class_type: class_type, instance_type: instance_type, resolve_self: resolve_self, resolve_class: resolve_class, resolve_instance: resolve_instance, variable_bounds: variable_bounds ) end