mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 15:32:26 +08:00
22 lines
355 B
Ruby
22 lines
355 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
require_relative "template_support"
|
||
|
|
||
|
module Onebox
|
||
|
class View < Mustache
|
||
|
include TemplateSupport
|
||
|
|
||
|
attr_reader :record
|
||
|
|
||
|
def initialize(name, record)
|
||
|
@record = record
|
||
|
self.template_name = name
|
||
|
self.template_path = load_paths.last
|
||
|
end
|
||
|
|
||
|
def to_html
|
||
|
render(record)
|
||
|
end
|
||
|
end
|
||
|
end
|