Class: Hashira::CI::Accepted::Entry

Inherits:
Data
  • Object
show all
Defined in:
lib/hashira/ci/accepted.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#digestObject (readonly)

Returns the value of attribute digest

Returns:

  • (Object)

    the current value of digest



10
11
12
# File 'lib/hashira/ci/accepted.rb', line 10

def digest
  @digest
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



10
11
12
# File 'lib/hashira/ci/accepted.rb', line 10

def kind
  @kind
end

#packageObject (readonly)

Returns the value of attribute package

Returns:

  • (Object)

    the current value of package



10
11
12
# File 'lib/hashira/ci/accepted.rb', line 10

def package
  @package
end

#reasonObject (readonly)

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



10
11
12
# File 'lib/hashira/ci/accepted.rb', line 10

def reason
  @reason
end

Class Method Details

.from(hash) ⇒ Object



11
12
13
# File 'lib/hashira/ci/accepted.rb', line 11

def self.from(hash)
  new(kind: hash["kind"], package: hash["package"], digest: hash["digest"], reason: hash["reason"])
end

Instance Method Details

#identityObject



17
# File 'lib/hashira/ci/accepted.rb', line 17

def identity = digest || package

#labelObject



19
# File 'lib/hashira/ci/accepted.rb', line 19

def label = reason || "accepted (no reason recorded)"

#matches?(finding) ⇒ Boolean

Returns:

  • (Boolean)


15
# File 'lib/hashira/ci/accepted.rb', line 15

def matches?(finding) = kind == finding.kind && identity == finding.identity

#to_hObject



21
# File 'lib/hashira/ci/accepted.rb', line 21

def to_h = { kind:, package:, digest:, reason: }.compact