Module: DataAttributes::Model

Extended by:
ActiveSupport::Concern
Defined in:
lib/data_attributes/model.rb

Instance Method Summary collapse

Instance Method Details

#data_attributesObject



35
36
37
38
39
40
41
# File 'lib/data_attributes/model.rb', line 35

def data_attributes
  {}.tap do |attributes|
    self.class.data_attributes.each do |attribute|
      attributes[attribute] = send(attribute) if respond_to?(attribute, true)
    end
  end
end