Class: DirValidator::Warning

Inherits:
Object
  • Object
show all
Defined in:
lib/dir_validator/warning.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vid, opts) ⇒ Warning

Returns a new instance of Warning.

Parameters:

  • vid (String)

    Validation identifier of the validation-method call that led to the warning.

  • opts (Hash)

    Validation-method options hash, along with some additional information about the context in which the warning was generated.



16
17
18
19
# File 'lib/dir_validator/warning.rb', line 16

def initialize(vid, opts)
  @vid  = vid
  @opts = opts
end

Instance Attribute Details

#optsHash (readonly)

Returns:

  • (Hash)

See Also:



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/dir_validator/warning.rb', line 7

class DirValidator::Warning

  attr_reader(:vid, :opts)

  # @param  vid  [String] Validation identifier of the validation-method call
  #                       that led to the warning.
  # @param  opts [Hash]   Validation-method options hash, along with some additional
  #                       information about the context in which the warning was
  #                       generated.
  def initialize(vid, opts)
    @vid  = vid
    @opts = opts
  end

  # Returns a basic representation of the information contained in the warning.
  #
  # @return [String]
  def to_s
    return "#{@vid}: #{@opts.inspect}"
  end

end

#vidString (readonly)

Returns:

  • (String)

See Also:



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/dir_validator/warning.rb', line 7

class DirValidator::Warning

  attr_reader(:vid, :opts)

  # @param  vid  [String] Validation identifier of the validation-method call
  #                       that led to the warning.
  # @param  opts [Hash]   Validation-method options hash, along with some additional
  #                       information about the context in which the warning was
  #                       generated.
  def initialize(vid, opts)
    @vid  = vid
    @opts = opts
  end

  # Returns a basic representation of the information contained in the warning.
  #
  # @return [String]
  def to_s
    return "#{@vid}: #{@opts.inspect}"
  end

end

Instance Method Details

#to_sString

Returns a basic representation of the information contained in the warning.

Returns:

  • (String)


24
25
26
# File 'lib/dir_validator/warning.rb', line 24

def to_s
  return "#{@vid}: #{@opts.inspect}"
end