Class: Fabrique::Test::Fixtures::Repository::CustomerDataMapper
- Inherits:
-
Object
- Object
- Fabrique::Test::Fixtures::Repository::CustomerDataMapper
- Defined in:
- lib/fabrique/test/fixtures/repository.rb
Instance Method Summary collapse
Instance Method Details
#from_dto(dto) ⇒ Object
111 112 113 |
# File 'lib/fabrique/test/fixtures/repository.rb', line 111 def from_dto(dto) Customer.new(id: dto[:id], name: dto[:name], date_of_birth: Date.parse(dto[:dob])) end |
#to_dto(entity) ⇒ Object
103 104 105 106 107 108 109 |
# File 'lib/fabrique/test/fixtures/repository.rb', line 103 def to_dto(entity) { id: entity.id, name: entity.name, dob: entity.date_of_birth.iso8601 } end |