Class: Dry::Schema::Message::Or::MultiPath::MessageArray Private

Inherits:
Object
  • Object
show all
Defined in:
lib/dry/schema/message/or/multi_path.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(messages) ⇒ MessageArray

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of MessageArray.



14
15
16
# File 'lib/dry/schema/message/or/multi_path.rb', line 14

def initialize(messages)
  @messages = messages.flatten
end

Instance Method Details

#_pathsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
# File 'lib/dry/schema/message/or/multi_path.rb', line 19

def _paths
  @messages.map(&:_path)
end

#to_hObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



29
30
31
# File 'lib/dry/schema/message/or/multi_path.rb', line 29

def to_h
  MessageSet.new(@messages).to_h
end

#to_or(root) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
# File 'lib/dry/schema/message/or/multi_path.rb', line 24

def to_or(root)
  self.class.new(@messages.map { _1.to_or(root) })
end