Sha256: 2e6d36d73b65e8affc4c7d2db93db77403c001844e7f39db1cc2f534a4bd95fc

Contents?: true

Size: 477 Bytes

Versions: 664

Compression:

Stored size: 477 Bytes

Contents

module Caboose
  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

664 entries across 664 versions & 1 rubygems

Version Path
caboose-cms-0.9.190 app/models/caboose/message.rb
caboose-cms-0.9.189 app/models/caboose/message.rb
caboose-cms-0.9.188 app/models/caboose/message.rb
caboose-cms-0.9.187 app/models/caboose/message.rb
caboose-cms-0.9.186 app/models/caboose/message.rb
caboose-cms-0.9.185 app/models/caboose/message.rb
caboose-cms-0.9.184 app/models/caboose/message.rb
caboose-cms-0.9.183 app/models/caboose/message.rb
caboose-cms-0.9.182 app/models/caboose/message.rb
caboose-cms-0.9.181 app/models/caboose/message.rb
caboose-cms-0.9.180 app/models/caboose/message.rb
caboose-cms-0.9.179 app/models/caboose/message.rb
caboose-cms-0.9.178 app/models/caboose/message.rb
caboose-cms-0.9.177 app/models/caboose/message.rb
caboose-cms-0.9.176 app/models/caboose/message.rb
caboose-cms-0.9.175 app/models/caboose/message.rb
caboose-cms-0.9.174 app/models/caboose/message.rb
caboose-cms-0.9.173 app/models/caboose/message.rb
caboose-cms-0.9.172 app/models/caboose/message.rb
caboose-cms-0.9.171 app/models/caboose/message.rb