2018-08-04 20:30:44 +00:00
|
|
|
macro add_mapping(mapping)
|
|
|
|
def initialize({{*mapping.keys.map { |id| "@#{id}".id }}})
|
|
|
|
end
|
|
|
|
|
|
|
|
def to_a
|
|
|
|
return [{{*mapping.keys.map { |id| "@#{id}".id }}}]
|
|
|
|
end
|
|
|
|
|
|
|
|
DB.mapping({{mapping}})
|
|
|
|
end
|
|
|
|
|
2018-08-16 01:31:47 +00:00
|
|
|
macro templated(filename, template = "template")
|
2018-08-11 15:52:13 +00:00
|
|
|
render "src/invidious/views/#{{{filename}}}.ecr", "src/invidious/views/#{{{template}}}.ecr"
|
2018-08-04 20:30:44 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
macro rendered(filename)
|
|
|
|
render "src/invidious/views/#{{{filename}}}.ecr"
|
|
|
|
end
|