Class: Arbetsformedlingen::Document
- Defined in:
- lib/arbetsformedlingen/models/document.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
-
#initialize(hash) ⇒ Document
constructor
A new instance of Document.
Methods inherited from Model
#errors, from_schema, #to_h, #valid?
Constructor Details
#initialize(hash) ⇒ Document
Returns a new instance of Document.
21 22 23 24 25 26 27 28 |
# File 'lib/arbetsformedlingen/models/document.rb', line 21 def initialize(hash) data = { id: SecureRandom.uuid, timestamp: Time.now.utc.iso8601, }.merge!(hash) super(DocumentSchema.call(data)) end |