Sha256: 8bd57bf7fb387b6501867a76aef540a4c5302341155609c1f0c0a5dca768b0c6

Contents?: true

Size: 423 Bytes

Versions: 46

Compression:

Stored size: 423 Bytes

Contents

module ActiveModel
  
  class Error
    
    attr_reader :messages
    
    def initialize(msgs = {})
      @messages = msgs || {}
      @messages.each { |attribute, messages| @messages[attribute] = messages.uniq }
    end
    
    def [](attribute)
      messages[attribute]
    end
    
    def delete(attribute)
      messages.delete(attribute)
    end
    
    def empty?
      messages.empty?
    end
    
  end
  
end

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
reactive-record-0.7.39 lib/reactive_record/active_record/error.rb
reactive-record-0.7.38 lib/reactive_record/active_record/error.rb
reactive-record-0.7.37 lib/reactive_record/active_record/error.rb
reactive-record-0.7.36 lib/reactive_record/active_record/error.rb
reactive-record-0.7.35 lib/reactive_record/active_record/error.rb
reactive-record-0.7.34 lib/reactive_record/active_record/error.rb
reactive-record-0.7.33 lib/reactive_record/active_record/error.rb
reactive-record-0.7.32 lib/reactive_record/active_record/error.rb
reactive-record-0.7.31 lib/reactive_record/active_record/error.rb
reactive-record-0.7.30 lib/reactive_record/active_record/error.rb
reactive-record-0.7.29 lib/reactive_record/active_record/error.rb
reactive-record-0.7.28 lib/reactive_record/active_record/error.rb
reactive-record-0.7.27 lib/reactive_record/active_record/error.rb
reactive-record-0.7.26 lib/reactive_record/active_record/error.rb
reactive-record-0.7.25 lib/reactive_record/active_record/error.rb
reactive-record-0.7.24 lib/reactive_record/active_record/error.rb
reactive-record-0.7.22 lib/reactive_record/active_record/error.rb
reactive-record-0.7.20 lib/reactive_record/active_record/error.rb
reactive-record-0.7.19 lib/reactive_record/active_record/error.rb
reactive-record-0.7.18 lib/reactive_record/active_record/error.rb