Class: Bundler::Audit::Results::InsecureSource

Inherits:
Result
  • Object
show all
Defined in:
lib/bundler/audit/results/insecure_source.rb

Overview

Represents an insecure gem source (ex: git://... or http://...).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ InsecureSource

Initializes the insecure source result.

Parameters:

  • source (URI::Generic, URI::HTTP)

    The insecure git:// or http:// URI.



39
40
41
# File 'lib/bundler/audit/results/insecure_source.rb', line 39

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceURI::Generic, URI::HTTP (readonly)

The insecure git:// or http:// URI.

Returns:

  • (URI::Generic, URI::HTTP)


31
32
33
# File 'lib/bundler/audit/results/insecure_source.rb', line 31

def source
  @source
end

Instance Method Details

#==(other) ⇒ Boolean

Compares the insecure source with another result.

Parameters:

Returns:

  • (Boolean)


50
51
52
# File 'lib/bundler/audit/results/insecure_source.rb', line 50

def ==(other)
  self.class == other.class && @source == other.source
end

#to_hHash{Symbol => Object}

Converts the insecure source into a Hash.

Returns:

  • (Hash{Symbol => Object})


68
69
70
71
72
73
# File 'lib/bundler/audit/results/insecure_source.rb', line 68

def to_h
  {
    type: :insecure_source,
    source: @source
  }
end

#to_sString

Converts the insecure source result to a String.

Returns:

  • (String)


59
60
61
# File 'lib/bundler/audit/results/insecure_source.rb', line 59

def to_s
  @source.to_s
end