Class: Emailvision4rails::Base
- Inherits:
-
Object
- Object
- Emailvision4rails::Base
- Extended by:
- ActiveModel::Callbacks, ActiveModel::Naming
- Includes:
- ActiveModel::AttributeMethods, ActiveModel::Conversion, ActiveModel::Validations
- Defined in:
- lib/emailvision4rails/models/base.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.attributes(*names) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/emailvision4rails/models/base.rb', line 24 def self.attributes(*names) attr_accessor *names define_attribute_methods names self._attributes += names end |
Instance Method Details
#attributes ⇒ Object
31 32 33 34 35 36 |
# File 'lib/emailvision4rails/models/base.rb', line 31 def attributes self._attributes.inject({}) do |hash, attr| hash[attr.to_s] = send(attr) hash end end |
#persisted? ⇒ Boolean
38 39 40 |
# File 'lib/emailvision4rails/models/base.rb', line 38 def persisted? false end |
#to_emv ⇒ Object
42 43 44 |
# File 'lib/emailvision4rails/models/base.rb', line 42 def to_emv attributes.reject {|k,v| v.nil?} end |