Module: Rtlize

Defined in:
lib/rtlize.rb,
lib/rtlize/exec.rb,
lib/rtlize/helpers.rb,
lib/rtlize/railtie.rb,
lib/rtlize/rtlizer.rb,
lib/rtlize/version.rb,
lib/rtlize/declaration.rb,
lib/rtlize/rtl_processor.rb

Defined Under Namespace

Classes: Declaration, Exec, RTLizer, Railtie, RtlProcessor

Constant Summary collapse

VERSION =
"1.0.0"

Class Method Summary collapse

Class Method Details

.dir(locale = I18n.locale) ⇒ Object



2
3
4
# File 'lib/rtlize/helpers.rb', line 2

def self.dir(locale = I18n.locale)
  Rtlize.rtl_locales.include?(locale.to_sym) ? 'rtl' : 'ltr'
end

.rtl_localesObject



12
13
14
# File 'lib/rtlize/rtlizer.rb', line 12

def self.rtl_locales
  @@rtl_locales ||= [:ar, :fa, :he, :ur]
end

.rtl_locales=(locales) ⇒ Object



16
17
18
# File 'lib/rtlize/rtlizer.rb', line 16

def self.rtl_locales=(locales)
  @@rtl_locales = locales
end

.rtl_selectorObject



4
5
6
# File 'lib/rtlize/rtlizer.rb', line 4

def self.rtl_selector
  @@rtl_selector ||= "[dir=rtl]"
end

.rtl_selector=(selector) ⇒ Object



8
9
10
# File 'lib/rtlize/rtlizer.rb', line 8

def self.rtl_selector=(selector)
  @@rtl_selector = selector
end