Module: Hypostasis::ColumnGroup

Extended by:
ActiveSupport::Concern
Includes:
BelongsTo, Findable, HasMany, HasOne, Persistence, Shared::Fields, Shared::Indexes, Shared::Namespaced, Shared::Utilities
Defined in:
lib/hypostasis/column_group.rb,
lib/hypostasis/column_group/has_one.rb,
lib/hypostasis/column_group/findable.rb,
lib/hypostasis/column_group/has_many.rb,
lib/hypostasis/column_group/belongs_to.rb,
lib/hypostasis/column_group/persistence.rb

Defined Under Namespace

Modules: BelongsTo, ClassMethods, Findable, HasMany, HasOne, Persistence

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Persistence

#destroy, #save

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



27
28
29
# File 'lib/hypostasis/column_group.rb', line 27

def id
  @id
end

Instance Method Details

#generate_idObject



38
39
40
# File 'lib/hypostasis/column_group.rb', line 38

def generate_id
  @id ||= SecureRandom.uuid
end

#initialize(*attributes) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/hypostasis/column_group.rb', line 29

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

#set_id(id) ⇒ Object



42
43
44
# File 'lib/hypostasis/column_group.rb', line 42

def set_id(id)
  @id ||= id.to_s
end