class Solargraph::Page::Binder
@todo This method directive is necessary because OpenStruct.new confuses
the typechecker.
@!method self.new(locals, render_method)
@param locals[Hash] @param render_method [Proc] @return [Binder]
Public Class Methods
Source
# File lib/solargraph/page.rb, line 19 def initialize locals, render_method super(locals) define_singleton_method :render do |template, layout: false, locals: {}| render_method.call(template, layout: layout, locals: locals) end define_singleton_method :erb do |template, layout: false, locals: {}| render_method.call(template, layout: layout, locals: locals) end end
@param locals [Hash] @param render_method [Proc]
Calls superclass method
Public Instance Methods
Source
# File lib/solargraph/page.rb, line 38 def escape text CGI.escapeHTML(text) end
@param text [String] @return [String]
Source
# File lib/solargraph/page.rb, line 31 def htmlify text # @type [String] YARD::Templates::Helpers::Markup::RDocMarkup.new(text).to_html end
@param text [String] @return [String]
Source
# File lib/solargraph/page.rb, line 44 def ruby_to_html code code end
@param code [String] @return [String]