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
hyper-mesh-1.0.0.lap27 lib/reactive_record/active_record/error.rb
hyper-mesh-1.0.0.lap26 lib/reactive_record/active_record/error.rb
hyper-mesh-1.0.0.lap25 lib/reactive_record/active_record/error.rb
hyper-mesh-1.0.0.lap24 lib/reactive_record/active_record/error.rb
hyper-mesh-1.0.0.lap23 lib/reactive_record/active_record/error.rb
hyper-mesh-1.0.0.lap22 lib/reactive_record/active_record/error.rb
hyper-mesh-0.6.0 lib/reactive_record/active_record/error.rb
hyper-mesh-0.5.4 lib/reactive_record/active_record/error.rb
hyper-mesh-0.5.3 lib/reactive_record/active_record/error.rb
hyper-mesh-0.5.2 lib/reactive_record/active_record/error.rb
hyper-mesh-0.5.1 lib/reactive_record/active_record/error.rb
hyper-mesh-0.5.0 lib/reactive_record/active_record/error.rb
hyper-mesh-0.4.0 lib/reactive_record/active_record/error.rb
reactive-record-0.8.3 lib/reactive_record/active_record/error.rb
reactive-record-0.8.2 lib/reactive_record/active_record/error.rb
reactive-record-0.8.1 lib/reactive_record/active_record/error.rb
reactive-record-0.7.43 lib/reactive_record/active_record/error.rb
reactive-record-0.7.42 lib/reactive_record/active_record/error.rb
reactive-record-0.7.41 lib/reactive_record/active_record/error.rb
reactive-record-0.7.40 lib/reactive_record/active_record/error.rb