Class: Rigor::FlowContribution::Element

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

Instance Attribute Summary collapse

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 Attribute Details

#edgeObject (readonly)

Returns the value of attribute edge

Returns:

  • (Object)

    the current value of edge



31
32
33
# File 'lib/rigor/flow_contribution/element.rb', line 31

def edge
  @edge
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



31
32
33
# File 'lib/rigor/flow_contribution/element.rb', line 31

def kind
  @kind
end

#payloadObject (readonly)

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



31
32
33
# File 'lib/rigor/flow_contribution/element.rb', line 31

def payload
  @payload
end

#provenanceObject (readonly)

Returns the value of attribute provenance

Returns:

  • (Object)

    the current value of provenance



31
32
33
# File 'lib/rigor/flow_contribution/element.rb', line 31

def provenance
  @provenance
end

#targetObject (readonly)

Returns the value of attribute target

Returns:

  • (Object)

    the current value of target



31
32
33
# File 'lib/rigor/flow_contribution/element.rb', line 31

def target
  @target
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