Class: Interactor::Contracts::BreachSet
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Interactor::Contracts::BreachSet
- Defined in:
- lib/interactor/contracts/breach_set.rb
Overview
A simple wrapper around set of breaches of contract constraints
Instance Method Summary collapse
-
#to_hash ⇒ Hash
(also: #to_h)
Converts the breach set into a Hash for use with context failing.
Instance Method Details
#to_hash ⇒ Hash Also known as: to_h
Converts the breach set into a Hash for use with context failing
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/interactor/contracts/breach_set.rb', line 39 def to_hash each_with_object({}) do |(property, ), result| result[property] = if .is_a?(Hash) Hash(result[property]).merge() else Array(result[property]) | end result end end |