Class: Strict::Violation

Inherits:
Data
  • Object
show all
Defined in:
lib/strict/violation.rb,
sig/strict.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:, code:, value:, validator:) ⇒ Violation

Returns a new instance of Violation.



5
6
7
# File 'lib/strict/violation.rb', line 5

def initialize(path:, code:, value:, validator:)
  super(path: path.dup.freeze, code: code, value: value, validator: validator)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code



4
5
6
# File 'lib/strict/violation.rb', line 4

def code
  @code
end

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



4
5
6
# File 'lib/strict/violation.rb', line 4

def path
  @path
end

#validatorObject (readonly)

Returns the value of attribute validator

Returns:

  • (Object)

    the current value of validator



4
5
6
# File 'lib/strict/violation.rb', line 4

def validator
  @validator
end

#valueObject (readonly)

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



4
5
6
# File 'lib/strict/violation.rb', line 4

def value
  @value
end