Class: Orchestrate::Application::RefTable

Inherits:
Record
  • Object
show all
Defined in:
lib/orchestrate_application/ref_table.rb

Constant Summary collapse

@@is_enabled =
false
@@collection_name =
'orchio_ref_table'

Instance Attribute Summary

Attributes inherited from Record

#__ref_value__, #id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Record

#orchestrate_client, #orchestrate_collection_name, #orchestrate_primary_key, #orchestrate_ref_value, orchio_delete, #orchio_delete, #orchio_delete_graph, orchio_delete_key, #orchio_get, #orchio_get_by_ref, #orchio_get_events, #orchio_get_graph, orchio_list, #orchio_purge, #orchio_put, #orchio_put_event, #orchio_put_graph, #orchio_put_if_match, #orchio_put_if_none_match, orchio_search

Constructor Details

#initialize(params = {}) ⇒ RefTable

Returns a new instance of RefTable.



8
9
10
11
12
# File 'lib/orchestrate_application/ref_table.rb', line 8

def initialize(params={})
  return unless @@is_enabled == true
  params[:define_collection_name] = @@collection_name
  super params
end

Class Method Details

.disableObject



24
25
26
27
# File 'lib/orchestrate_application/ref_table.rb', line 24

def self.disable
  puts "DISABLE REF TABLE"
  @@is_enabled = false
end

.enable(name = nil) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/orchestrate_application/ref_table.rb', line 14

def self.enable(name = nil)
  puts "ENABLE REF TABLE"
  @@is_enabled = true
  @@collection_name = name unless name.blank?
  Orchestrate::Application::Schema.instance.define_collection(
    :name       => @@collection_name,
    :properties => [ :xcollection, :xkey, :timestamp, :xref]
  )
end

.enabled?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/orchestrate_application/ref_table.rb', line 29

def self.enabled?
  @@is_enabled == true
end

.get_collection_nameObject



33
34
35
# File 'lib/orchestrate_application/ref_table.rb', line 33

def self.get_collection_name
  @@collection_name
end