Class: FailFast::ErrorDetails

Inherits:
Struct
  • Object
show all
Defined in:
lib/fail_fast/support/error_details.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, kind, value = nil, message = nil) ⇒ ErrorDetails

Returns a new instance of ErrorDetails.



5
6
7
# File 'lib/fail_fast/support/error_details.rb', line 5

def initialize(key, kind, value=nil, message=nil)
  @key, @kind, @value, @message = key, kind, value, message
end

Instance Attribute Details

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



1
2
3
# File 'lib/fail_fast/support/error_details.rb', line 1

def key
  @key
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



1
2
3
# File 'lib/fail_fast/support/error_details.rb', line 1

def kind
  @kind
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



1
2
3
# File 'lib/fail_fast/support/error_details.rb', line 1

def message
  @message
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



1
2
3
# File 'lib/fail_fast/support/error_details.rb', line 1

def value
  @value
end

Instance Method Details

#has_key_and_kind?(akey, akind) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/fail_fast/support/error_details.rb', line 9

def has_key_and_kind?(akey, akind)
  (key.to_s == akey.to_s) && kind.to_sym == akind.to_sym
end

#has_value_and_kind?(avalue, akind) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/fail_fast/support/error_details.rb', line 13

def has_value_and_kind?(avalue, akind)
  (value.to_s == avalue.to_s) && kind.to_sym == akind.to_sym
end