Class: Homebrew::Attestation::Verifier::ValidityPeriod Private

Inherits:
T::Struct
  • Object
show all
Defined in:
attestation/verifier.rb

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start_time:, end_time: nil) ⇒ void

Parameters:

  • start_time (Time)
  • end_time (Time, nil) (defaults to: nil)


# File ''

const :start_time, Time
const :end_time, T.nilable(Time)

Instance Attribute Details

#end_time ⇒ Time? (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop end_time.

Returns:



# File ''

const :end_time, T.nilable(Time)

#start_time ⇒ Time (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns the value of prop start_time.

Returns:



# File ''

const :start_time, Time

Instance Method Details

#covers?(time) ⇒ Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:

  • (Boolean)


85
86
87
88
# File 'attestation/verifier.rb', line 85

def covers?(time)
  expiry = end_time
  time >= start_time && (!expiry || time <= expiry)
end