Class: Rigor::FlowContribution::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/rigor/flow_contribution/element.rb

Instance Method Summary collapse

Constructor Details

#initialize(target:, edge:, kind:, payload:, provenance:) ⇒ Element

Returns a new instance of Element.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/rigor/flow_contribution/element.rb', line 32

def initialize(target:, edge:, kind:, payload:, provenance:)
  unless ELEMENT_VALID_EDGES.include?(edge)
    raise ArgumentError,
          "FlowContribution::Element edge must be one of " \
          "#{ELEMENT_VALID_EDGES.inspect}, got #{edge.inspect}"
  end

  unless ELEMENT_VALID_KINDS.include?(kind)
    raise ArgumentError,
          "FlowContribution::Element kind must be one of " \
          "#{ELEMENT_VALID_KINDS.inspect}, got #{kind.inspect}"
  end

  super
end

Instance Method Details

#merge_keyObject



48
49
50
# File 'lib/rigor/flow_contribution/element.rb', line 48

def merge_key
  [target, edge, kind]
end