Class: Smith::Workflow::Graph::Diagnostic
- Inherits:
-
Object
- Object
- Smith::Workflow::Graph::Diagnostic
- Defined in:
- lib/smith/workflow/graph/diagnostic.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#suggestion ⇒ Object
readonly
Returns the value of attribute suggestion.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#transition ⇒ Object
readonly
Returns the value of attribute transition.
Instance Method Summary collapse
-
#initialize(**attributes) ⇒ Diagnostic
constructor
A new instance of Diagnostic.
- #to_h ⇒ Object
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
#code ⇒ Object (readonly)
Returns the value of attribute code.
7 8 9 |
# File 'lib/smith/workflow/graph/diagnostic.rb', line 7 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/smith/workflow/graph/diagnostic.rb', line 7 def @message end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity.
7 8 9 |
# File 'lib/smith/workflow/graph/diagnostic.rb', line 7 def severity @severity end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
7 8 9 |
# File 'lib/smith/workflow/graph/diagnostic.rb', line 7 def state @state end |
#suggestion ⇒ Object (readonly)
Returns the value of attribute suggestion.
7 8 9 |
# File 'lib/smith/workflow/graph/diagnostic.rb', line 7 def suggestion @suggestion end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
7 8 9 |
# File 'lib/smith/workflow/graph/diagnostic.rb', line 7 def target @target end |
#transition ⇒ Object (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_h ⇒ Object
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: , state: state, transition: transition, target: target, suggestion: suggestion }.compact end |