Class: Smith::Workflow::Graph::Diagnostic

Inherits:
Object
  • Object
show all
Defined in:
lib/smith/workflow/graph/diagnostic.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**attributes) ⇒ Diagnostic

Returns a new instance of Diagnostic.



9
10
11
12
13
14
15
16
17
# File 'lib/smith/workflow/graph/diagnostic.rb', line 9

def initialize(**attributes)
  @severity = attributes.fetch(:severity)
  @code = attributes.fetch(:code)
  @message = attributes.fetch(:message)
  @state = attributes[:state]
  @transition = attributes[:transition]
  @target = attributes[:target]
  @suggestion = attributes[:suggestion]
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



7
8
9
# File 'lib/smith/workflow/graph/diagnostic.rb', line 7

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



7
8
9
# File 'lib/smith/workflow/graph/diagnostic.rb', line 7

def message
  @message
end

#severityObject (readonly)

Returns the value of attribute severity.



7
8
9
# File 'lib/smith/workflow/graph/diagnostic.rb', line 7

def severity
  @severity
end

#stateObject (readonly)

Returns the value of attribute state.



7
8
9
# File 'lib/smith/workflow/graph/diagnostic.rb', line 7

def state
  @state
end

#suggestionObject (readonly)

Returns the value of attribute suggestion.



7
8
9
# File 'lib/smith/workflow/graph/diagnostic.rb', line 7

def suggestion
  @suggestion
end

#targetObject (readonly)

Returns the value of attribute target.



7
8
9
# File 'lib/smith/workflow/graph/diagnostic.rb', line 7

def target
  @target
end

#transitionObject (readonly)

Returns the value of attribute transition.



7
8
9
# File 'lib/smith/workflow/graph/diagnostic.rb', line 7

def transition
  @transition
end

Instance Method Details

#to_hObject



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/smith/workflow/graph/diagnostic.rb', line 19

def to_h
  {
    severity: severity,
    code: code,
    message: message,
    state: state,
    transition: transition,
    target: target,
    suggestion: suggestion
  }.compact
end