Class: Orchestrate::Application::PrimaryKey
- Inherits:
-
Object
- Object
- Orchestrate::Application::PrimaryKey
- Defined in:
- lib/orchestrate_application/simple_cache_store.rb
Overview
Class PrimaryKey
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#graphs ⇒ Object
readonly
Returns the value of attribute graphs.
-
#ref ⇒ Object
Returns the value of attribute ref.
Instance Method Summary collapse
- #add_event(etype, ref = nil) ⇒ Object
- #add_graph(data) ⇒ Object
-
#initialize(ref) ⇒ PrimaryKey
constructor
A new instance of PrimaryKey.
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
#events ⇒ Object (readonly)
Returns the value of attribute events.
6 7 8 |
# File 'lib/orchestrate_application/simple_cache_store.rb', line 6 def events @events end |
#graphs ⇒ Object (readonly)
Returns the value of attribute graphs.
6 7 8 |
# File 'lib/orchestrate_application/simple_cache_store.rb', line 6 def graphs @graphs end |
#ref ⇒ Object
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 |