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

#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
# File 'lib/hashira/ci/accepted.rb', line 11

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

Instance Method Details

#labelObject



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

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

#matches?(finding) ⇒ Boolean

Returns:

  • (Boolean)


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

def matches?(finding) = [kind, package] == [finding.kind, finding.package]

#to_hObject



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

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