module Hypostasis::Shared
Attributes
id[R]
Public Class Methods
new(*attributes)
click to toggle source
# File lib/hypostasis/shared.rb, line 14 def initialize(*attributes) self.class.namespace.open @fields = {} self.class.fields.each {|name| @fields[name] = nil} attributes.each {|hsh| hsh.each {|name, value| @fields[name.to_sym] = value}} self end
Public Instance Methods
generate_id()
click to toggle source
# File lib/hypostasis/shared.rb, line 22 def generate_id @id ||= SecureRandom.uuid end
set_id(id)
click to toggle source
# File lib/hypostasis/shared.rb, line 26 def set_id(id) @id ||= id.to_s end