class Dry::Schema::Message
@api public
@see Message
Hint-specific Message extensions
def <=>(other)
- 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
- Api: - private
def _path @_path ||= Path[path] end
def dump
- Api: - public
Returns:
-
(String, Hash)
-
def dump @dump ||= meta.empty? ? text : {text: text, **meta} end
def eql?(other)
- Api: - private
Returns:
-
(Boolean)
-
Parameters:
-
other
(Message, String
) --
def eql?(other) other.is_a?(String) ? text == other : super end
def hint?
- Api: - private
def hint? false end
def to_h
- Api: - public
Returns:
-
(Hash)
-
Other tags:
- See: Message#to_h -
def to_h @to_h ||= _path.to_h(dump) end
def to_or(root)
- 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