class Dry::Schema::Message

@api public
@see Message
Hint-specific Message extensions

def <=>(other)

Other tags:
    Api: - private
def <=>(other)
  l_path = _path
  r_path = other._path
  unless l_path.same_root?(r_path)
    raise ArgumentError, "Cannot compare messages from different root paths"
  end
  l_path <=> r_path
end

def _path

Other tags:
    Api: - private
def _path
  @_path ||= Path[path]
end

def dump

Other tags:
    Api: - public

Returns:
  • (String, Hash) -
def dump
  @dump ||= meta.empty? ? text : {text: text, **meta}
end

def eql?(other)

Other tags:
    Api: - private

Returns:
  • (Boolean) -

Parameters:
  • other (Message, String) --
def eql?(other)
  other.is_a?(String) ? text == other : super
end

def hint?

Other tags:
    Api: - private
def hint?
  false
end

def to_h

Other tags:
    Api: - public

Returns:
  • (Hash) -

Other tags:
    See: Message#to_h -
def to_h
  @to_h ||= _path.to_h(dump)
end

def to_or(root)

Other tags:
    Api: - private
def to_or(root)
  clone = dup
  clone.instance_variable_set("@path", path - root.to_a)
  clone.instance_variable_set("@_path", nil)
  clone
end