Class: SorbetProgress::Metrics
- Inherits:
-
Object
- Object
- SorbetProgress::Metrics
- Extended by:
- T::Sig
- Defined in:
- lib/sorbet_progress/metrics.rb
Overview
A collection of ‘Metric`s. Acts like a Hash, though sorbet actually gives us an array.
Instance Method Summary collapse
- #[](name) ⇒ Object
- #fetch(name) ⇒ Object
-
#initialize(array) ⇒ Metrics
constructor
A new instance of Metrics.
Constructor Details
#initialize(array) ⇒ Metrics
Returns a new instance of Metrics.
14 15 16 |
# File 'lib/sorbet_progress/metrics.rb', line 14 def initialize(array) @array = array end |
Instance Method Details
#[](name) ⇒ Object
19 20 21 |
# File 'lib/sorbet_progress/metrics.rb', line 19 def [](name) @array.find { |metric| metric.name == name } end |