Module: AR2DTO::HasDTO::InstanceMethods

Defined in:
lib/ar2dto/has_dto.rb

Overview

Wrap the following methods in a module so we can include them only in the ActiveRecord models that declare ‘has_dto`.

Instance Method Summary collapse

Instance Method Details

#to_dto(options = {}) ⇒ Object



40
41
42
43
44
# File 'lib/ar2dto/has_dto.rb', line 40

def to_dto(options = {})
  self.class.ar2dto.namespaced_class_name.constantize.new(
    AR2DTO::Converter.new(self, options).serializable_hash
  )
end