Sha256: 26f0e75b233f1ff073f810d267af537c271f93ae4c02c8c0c64e31aff7e89e2a
Contents?: true
Size: 533 Bytes
Versions: 14
Compression:
Stored size: 533 Bytes
Contents
class Contact include ActiveModel::Validations include ActiveModel::Conversion extend ActiveModel::Naming attr_accessor :name, :email, :subject, :body validates_presence_of :name validates_format_of :email, :with => /^[-a-z0-9_+\.]+\@([-a-z0-9]+\.)+[a-z0-9]{2,4}$/i validates_presence_of :email validates_presence_of :subject validates_presence_of :body def initialize(attributes = {}) attributes.each do |name, value| send("#{name}=", value) end end def persisted? false end end
Version data entries
14 entries across 14 versions & 1 rubygems