Class: SixthSense::Model::Assertion

Inherits:
Struct
  • Object
show all
Defined in:
lib/sixth_sense/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



61
62
63
# File 'lib/sixth_sense/model.rb', line 61

def location
  @location
end

#matcherObject

Returns the value of attribute matcher

Returns:

  • (Object)

    the current value of matcher



61
62
63
# File 'lib/sixth_sense/model.rb', line 61

def matcher
  @matcher
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



61
62
63
# File 'lib/sixth_sense/model.rb', line 61

def message
  @message
end

#subject_exprObject

Returns the value of attribute subject_expr

Returns:

  • (Object)

    the current value of subject_expr



61
62
63
# File 'lib/sixth_sense/model.rb', line 61

def subject_expr
  @subject_expr
end

Instance Method Details

#signatureObject



68
69
70
# File 'lib/sixth_sense/model.rb', line 68

def signature
  [matcher.to_s, subject_expr.to_s.gsub(/\s+/, " ").strip].join(":")
end

#to_hObject



72
73
74
75
76
77
78
79
# File 'lib/sixth_sense/model.rb', line 72

def to_h
  {
    location: location&.to_h,
    matcher: matcher,
    subject_expr: subject_expr,
    message: message
  }
end