Module: StringDirection::StringMethods
- Defined in:
- lib/string-direction/string_methods.rb
Overview
Methods intended to be monkey patched to String through String.include(StringDirection::StringMethods). This will allow stuff like 'English'.direction #=> 'ltr'. All methods are delegated to Detector with self as string argument.
Instance Method Summary collapse
Instance Method Details
#bidi? ⇒ Boolean
21 22 23 |
# File 'lib/string-direction/string_methods.rb', line 21 def bidi? string_direction_detector.bidi?(self) end |
#direction ⇒ String
6 7 8 |
# File 'lib/string-direction/string_methods.rb', line 6 def direction string_direction_detector.direction(self) end |
#ltr? ⇒ Boolean
11 12 13 |
# File 'lib/string-direction/string_methods.rb', line 11 def ltr? string_direction_detector.ltr?(self) end |
#rtl? ⇒ Boolean
16 17 18 |
# File 'lib/string-direction/string_methods.rb', line 16 def rtl? string_direction_detector.rtl?(self) end |