Class: Necropsy::Blocker

Inherits:
Data
  • Object
show all
Defined in:
lib/necropsy/models.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind:, scope_kind:, scope_value:, source:, reason:, suggested_action: :review, metadata: {}) ⇒ Blocker

Returns a new instance of Blocker.



901
902
903
# File 'lib/necropsy/models.rb', line 901

def initialize(kind:, scope_kind:, scope_value:, source:, reason:, suggested_action: :review, metadata: {})
  super
end

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



900
901
902
# File 'lib/necropsy/models.rb', line 900

def kind
  @kind
end

#metadataObject (readonly)

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



900
901
902
# File 'lib/necropsy/models.rb', line 900

def 
  @metadata
end

#reasonObject (readonly)

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



900
901
902
# File 'lib/necropsy/models.rb', line 900

def reason
  @reason
end

#scope_kindObject (readonly)

Returns the value of attribute scope_kind

Returns:

  • (Object)

    the current value of scope_kind



900
901
902
# File 'lib/necropsy/models.rb', line 900

def scope_kind
  @scope_kind
end

#scope_valueObject (readonly)

Returns the value of attribute scope_value

Returns:

  • (Object)

    the current value of scope_value



900
901
902
# File 'lib/necropsy/models.rb', line 900

def scope_value
  @scope_value
end

#sourceObject (readonly)

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



900
901
902
# File 'lib/necropsy/models.rb', line 900

def source
  @source
end

#suggested_actionObject (readonly)

Returns the value of attribute suggested_action

Returns:

  • (Object)

    the current value of suggested_action



900
901
902
# File 'lib/necropsy/models.rb', line 900

def suggested_action
  @suggested_action
end

Instance Method Details

#caller_domainObject



909
910
911
# File 'lib/necropsy/models.rb', line 909

def caller_domain
  (['caller_domain'] || [:caller_domain] || :runtime).to_sym
end

#messageObject



905
906
907
# File 'lib/necropsy/models.rb', line 905

def message
  ['message'] || [:message] || (scope_value if %i[message symbol].include?(scope_kind.to_sym))
end

#to_hObject



913
914
915
916
917
918
919
920
921
922
923
# File 'lib/necropsy/models.rb', line 913

def to_h
  {
    'kind' => kind.to_s,
    'scope_kind' => scope_kind.to_s,
    'scope_value' => scope_value,
    'source' => source.respond_to?(:to_h) ? source.to_h : source.to_s,
    'reason' => reason,
    'suggested_action' => suggested_action.to_s,
    'metadata' => 
  }
end