class Alephant::Renderer::Views::Html

Attributes

template_path[RW]

FIXME: remove this when we've gotten rid of all of the `self.template_path` directives

Public Instance Methods

render() click to toggle source
# File lib/alephant/renderer/views/html.rb, line 22
def render
  @renderer.render self
end
setup() click to toggle source
# File lib/alephant/renderer/views/html.rb, line 16
def setup
  @content_type = 'text/html'
  @translator = translator
  @renderer = renderer_engine
end

Private Instance Methods

locale() click to toggle source
# File lib/alephant/renderer/views/html.rb, line 51
def locale
  :en
end
renderer_engine() click to toggle source
# File lib/alephant/renderer/views/html.rb, line 43
def renderer_engine
  Alephant::Renderer::Engine::Mustache.new(base_path, template_name)
end
t(key, params = {}) click to toggle source
# File lib/alephant/renderer/views/html.rb, line 47
def t(key, params = {})
  @translator.t(key, params)
end
template_name() click to toggle source
# File lib/alephant/renderer/views/html.rb, line 55
def template_name
  Mustache.underscore(self.class.to_s).split('/').last
end
translations_path() click to toggle source
# File lib/alephant/renderer/views/html.rb, line 36
def translations_path
  File.join(
    Pathname.new(base_path).parent,
    'locale'
  )
end
translator() click to toggle source
# File lib/alephant/renderer/views/html.rb, line 28
def translator
  Alephant::Renderer::I18n::LocaleComponentYaml.new(
    locale,
    template_name,
    translations_path
  )
end