class Unitylock::Server::Entity::UnityFile
Public Class Methods
create(hash)
click to toggle source
# File lib/unitylock/server/entity/unityfile.rb, line 25 def create(hash) unityfile = UnityFile.new default_values = { updated_at: Time.now } default_values.merge(hash).each do |key,value| unityfile[key] = value end unityfile end
json_create(o)
click to toggle source
# File lib/unitylock/server/entity/unityfile.rb, line 21 def json_create(o) new(*o['v']) end
Public Instance Methods
to_hash()
click to toggle source
# File lib/unitylock/server/entity/unityfile.rb, line 12 def to_hash { user: self.user, file: self.file, updated_at: self.updated_at.strftime("%Y-%m-%d %H:%M:%S") } end
update()
click to toggle source
# File lib/unitylock/server/entity/unityfile.rb, line 7 def update self.updated_at = Time.now self end