Sha256: 8c3666799a30ec07947c38061bbe08c9aaf7b015ff0fbe5278f19ccfd4eab1be

Contents?: true

Size: 482 Bytes

Versions: 33

Compression:

Stored size: 482 Bytes

Contents

module CabooseStore
  class Message
    include ActiveModel::Validations
    include ActiveModel::Conversion
    extend ActiveModel::Naming
    
    attr_accessor :name, :email, :body
    
    validates :name, :email, :body, presence: true
    validates :email, format: { :with => %r{.+@.+\..+} }, allow_blank: false
    
    def initialize(attributes={})
      attributes.each { |name, value| send("#{name}=", value) }
    end
    
    def persisted?
      false
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
caboose-store-0.0.43 app/models/caboose_store/message.rb
caboose-store-0.0.42 app/models/caboose_store/message.rb
caboose-store-0.0.41 app/models/caboose_store/message.rb
caboose-store-0.0.40 app/models/caboose_store/message.rb
caboose-store-0.0.39 app/models/caboose_store/message.rb
caboose-store-0.0.38 app/models/caboose_store/message.rb
caboose-store-0.0.37 app/models/caboose_store/message.rb
caboose-store-0.0.36 app/models/caboose_store/message.rb
caboose-store-0.0.35 app/models/caboose_store/message.rb
caboose-store-0.0.34 app/models/caboose_store/message.rb
caboose-store-0.0.33 app/models/caboose_store/message.rb
caboose-store-0.0.32 app/models/caboose_store/message.rb
caboose-store-0.0.31 app/models/caboose_store/message.rb
caboose-store-0.0.30 app/models/caboose_store/message.rb
caboose-store-0.0.29 app/models/caboose_store/message.rb
caboose-store-0.0.28 app/models/caboose_store/message.rb
caboose-store-0.0.27 app/models/caboose_store/message.rb
caboose-store-0.0.26 app/models/caboose_store/message.rb
caboose-store-0.0.25 app/models/caboose_store/message.rb
caboose-store-0.0.24 app/models/caboose_store/message.rb