class Orchestrate::EventSource

Manages Event Types for a KeyValue item.

Attributes

kv_item[R]

@return [Orchestrate::KeyValue] The KeyValue to which the sourced events belong.

Public Class Methods

new(kv_item) click to toggle source

Instantiages a new EventSource manager. @param kv_item [Orchestrate::KeyValue] The KeyValue item to which events belong.

# File lib/orchestrate/event_source.rb, line 11
def initialize(kv_item)
  @kv_item = kv_item
  @types = {}
end

Public Instance Methods

==(other) click to toggle source

Equivalent to ‘String#==`. Compares by kv_item. @param other [Orchestrate::EventSource] the EventSource to compare against. @return [true, false]

# File lib/orchestrate/event_source.rb, line 26
def ==(other)
  other.kind_of?(Orchestrate::EventSource) && other.kv_item == kv_item
end
Also aliased as: eql?
[](event_type) click to toggle source

Accessor for event types. @param event_type [#to_s] The type key for the events. @return [EventType]

# File lib/orchestrate/event_source.rb, line 19
def [](event_type)
  @types[event_type.to_s] ||= EventType.new(@kv_item, event_type)
end
eql?(other)
Alias for: ==
to_s() click to toggle source

@return Pretty-Printed string representation

# File lib/orchestrate/event_source.rb, line 32
def to_s
  "#<Orchestrate::EventSource key_value=#{kv_item}>"
end