Class: Alula::LocaleTag

Inherits:
Block
  • Object
show all
Defined in:
lib/alula/core_ext/tags/locale.rb

Instance Attribute Summary

Attributes included from LiquidExt

#context

Instance Method Summary collapse

Methods included from LiquidExt

included, #initialize

Instance Method Details

#prepareObject



3
4
5
# File 'lib/alula/core_ext/tags/locale.rb', line 3

def prepare
  @lang = @markup.strip
end

#render(context) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/alula/core_ext/tags/locale.rb', line 7

def render(context)
  if @lang == context.locale
    super
  else
    ''
  end
end