mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Hide method to infer type of first in collection in given macro
This was a bit of a hack.
This commit is contained in:
parent
80fbe89b4c
commit
fa73bf3a60
1 changed files with 6 additions and 2 deletions
|
@ -64,11 +64,15 @@ module Spectator
|
||||||
{{collection}}
|
{{collection}}
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.{{var_name}}
|
def self.%first
|
||||||
%collection.first
|
%collection.first
|
||||||
end
|
end
|
||||||
|
|
||||||
\{% ::Spectator::Definitions::ALL[@type.id][:given] << {name: "{{var_name}}".id, collection: "{{collection}}".id, type_def: (@type.id + ".{{var_name}}").id} %}
|
\{% ::Spectator::Definitions::ALL[@type.id][:given] << {
|
||||||
|
name: "{{var_name}}".id,
|
||||||
|
collection: "{{collection}}".id,
|
||||||
|
type_def: (@type.id + '.' + :%first.stringify[1..-1]).id
|
||||||
|
} %}
|
||||||
|
|
||||||
{{block.body}}
|
{{block.body}}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue