mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Output Tuple info
This commit is contained in:
parent
dba047e1ec
commit
acfed24e6c
1 changed files with 2 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
# Retrieves a value from the `NamedTuple` returned by `Spectator::Matchers::MatchData#values`.
|
||||
def match_data_value(match_data, key)
|
||||
puts typeof(match_data)
|
||||
match_data.values.fetch(key) { raise "#{key} is missing" }
|
||||
end
|
||||
|
||||
|
@ -7,6 +8,7 @@ end
|
|||
# from a `Spectator::Matchers::PrefixedValue`
|
||||
# in a `NamedTuple` returned by `Spectator::Matchers::MatchData#values`.
|
||||
def match_data_prefix(match_data, key)
|
||||
puts typeof(match_data)
|
||||
prefix = match_data.values.fetch(key) { raise "#{key} is missing" }
|
||||
if prefix.responds_to?(:value)
|
||||
{to_s: prefix.to_s, value: prefix.value}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue