lib/kamerling/registration.rb in kamerling-0.0.2 vs lib/kamerling/registration.rb in kamerling-0.0.3
- old
+ new
@@ -1,12 +1,11 @@
-module Kamerling class Registration < UUIDEntity
- attribute :addr, Addr
- attribute :client, Client
- attribute :project, Project
+require_relative 'addr'
+require_relative 'client'
+require_relative 'project'
+require_relative 'uuid_entity'
- def to_h
- super
- .reject { |key, _| key == :addr }.merge(addr.to_h)
- .reject { |key, _| key == :client }.merge(client_uuid: client.uuid)
- .reject { |key, _| key == :project }.merge project_uuid: project.uuid
+module Kamerling
+ class Registration < UUIDEntity
+ attrs addr: Addr, client: Client, project: Project, registered_at: Time
+ defaults registered_at: -> (*) { Time.now }
end
-end end
+end