Class: Orchestrate::Application::PrimaryKey

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

Overview

Class PrimaryKey

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ref) ⇒ PrimaryKey

Returns a new instance of PrimaryKey.



9
10
11
12
13
# File 'lib/orchestrate_application/simple_cache_store.rb', line 9

def initialize(ref)
  # puts "SCC-primary_key: '#{ref}'"
  @ref = ref
  @events, @graphs = {}, {}
end

Instance Attribute Details

#eventsObject (readonly)

Returns the value of attribute events.



6
7
8
# File 'lib/orchestrate_application/simple_cache_store.rb', line 6

def events
  @events
end

#graphsObject (readonly)

Returns the value of attribute graphs.



6
7
8
# File 'lib/orchestrate_application/simple_cache_store.rb', line 6

def graphs
  @graphs
end

#refObject

Returns the value of attribute ref.



7
8
9
# File 'lib/orchestrate_application/simple_cache_store.rb', line 7

def ref
  @ref
end

Instance Method Details

#add_event(etype, ref = nil) ⇒ Object



15
16
17
18
19
20
# File 'lib/orchestrate_application/simple_cache_store.rb', line 15

def add_event(etype, ref=nil)
  # puts "SCC-add event"
  @events[etype] = [] unless @events[etype]
  @events[etype] << ref if ref
  # puts "SCC-added event"
end

#add_graph(data) ⇒ Object



22
23
24
25
26
27
# File 'lib/orchestrate_application/simple_cache_store.rb', line 22

def add_graph(data)
  # puts "SCC-add graph: '#{data.kind}'"
  @graphs[data.kind] = [] unless @graphs[data.kind]
  @graphs[data.kind] << data.ref if data.ref
  # puts "SCC-added graph '#{@graphs[data.kind].last}'"
end