Method: FlowCore::Violations#to_hash

Defined in:
lib/flow_core/violations.rb

#to_hash(full_messages = false) ⇒ Object



112
113
114
115
116
117
118
119
120
# File 'lib/flow_core/violations.rb', line 112

def to_hash(full_messages = false)
  if full_messages
    messages.each_with_object({}) do |(record_key, array), messages|
      messages[record_key] = array.map { |message| full_message(record_key, message) }
    end
  else
    without_default_proc(messages)
  end
end