Skip to content

Commit

Permalink
Document valid_vehicle_position_generator opts
Browse files Browse the repository at this point in the history
  • Loading branch information
jzimbel-mbta committed Aug 23, 2024
1 parent 71c3223 commit 803d0dc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/support/generators/vehicle_position.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ defmodule TransitData.GlidesReport.Generators.VehiclePosition do
import ExUnitProperties, only: [gen: 2]
alias TransitData.GlidesReport.Terminals

# (Ignore first item, it keeps the formatter from moving the first comment)
@type vehicle_position_gen_opt ::
:___
# Override the list of possible current_status values.
| {:current_status, [String.t()]}
# Force all vehicle positions to have either Glides-terminal-relevant stop IDs, or not.
| {:stop_ids, :relevant | :irrelevant}
# Force all vehicle positions to have stop ID defined at .vehicle.stop_id, or not.
| {:define_stop_id, boolean}
# Force all vehicle positions to be revenue, or not.
| {:revenue, boolean}

@doc """
Returns a StreamData generator that yields valid vehicle positions.
Use opts to narrow the output.
"""
@spec valid_vehicle_position_generator([vehicle_position_gen_opt]) :: StreamData.t(map())
def valid_vehicle_position_generator(opts \\ []) do
current_status_members =
opts[:current_status] || ["INCOMING_AT", "IN_TRANSIT_TO", "STOPPED_AT"]
Expand Down

0 comments on commit 803d0dc

Please sign in to comment.