Skip to content
Snippets Groups Projects
Verified Commit 6449bca4 authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Allow creating models with identifier set

parent 93c5b224
No related branches found
No related tags found
No related merge requests found
Pipeline #100322 failed
......@@ -7,10 +7,11 @@ module LiudeskCMDB
class Model
attr_accessor :client
def initialize(client, **fields)
def initialize(client, identifier = nil, **fields)
@client = client
@data = {}
self.identifier = identifier if identifier
self.class.fields.each do |field, _|
@data[field] = fields[field] if fields.key? field
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment