class Steep::Interface::Shape

def initialize(type:, private:, methods: nil)

def initialize(type:, private:, methods: nil)
  @type = type
  @private = private
  @methods = methods || Methods.new(substs: [], methods: {})
end

def private?

def private?
  @private
end

def public?

def public?
  !private?
end

def subst(s, type: nil)

def subst(s, type: nil)
  ty =
    if type
      type
    else
      self.type.subst(s)
    end
  Shape.new(type: ty, private: private?, methods: methods.push_substitution(s))
end

def to_s

def to_s
  "#<#{self.class.name}: type=#{type}, private?=#{@private}, methods={#{methods.each_name.sort.join(", ")}}"
end

def update(type: self.type, methods: self.methods)

def update(type: self.type, methods: self.methods)
  _ = self.class.new(type: type, private: private?, methods: methods)
end