Module: Dry::Schema::Extensions::Hints::MessageSetMethods
- Included in:
- MessageSet
- Defined in:
- lib/dry/schema/extensions/hints/message_set_methods.rb
Instance Attribute Summary collapse
-
#failures ⇒ Object
readonly
Returns the value of attribute failures.
-
#hints ⇒ Object
readonly
Returns the value of attribute hints.
Instance Method Summary collapse
- #initialize(messages, options = EMPTY_HASH) ⇒ Object private
- #to_h ⇒ Object (also: #to_hash)
Instance Attribute Details
#failures ⇒ Object (readonly)
Returns the value of attribute failures.
8 9 10 |
# File 'lib/dry/schema/extensions/hints/message_set_methods.rb', line 8 def failures @failures end |
#hints ⇒ Object (readonly)
Returns the value of attribute hints.
8 9 10 |
# File 'lib/dry/schema/extensions/hints/message_set_methods.rb', line 8 def hints @hints end |
Instance Method Details
#initialize(messages, options = EMPTY_HASH) ⇒ 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.
11 12 13 14 15 |
# File 'lib/dry/schema/extensions/hints/message_set_methods.rb', line 11 def initialize(, = EMPTY_HASH) super @hints = .select(&:hint?) @failures = .fetch(:failures, true) end |
#to_h ⇒ Object Also known as: to_hash
18 19 20 |
# File 'lib/dry/schema/extensions/hints/message_set_methods.rb', line 18 def to_h failures ? : (hints) end |