Module: TypedViewModel::Helpers::TextHelpers
- Defined in:
- lib/typed_view_model/helpers/text_helpers.rb
Instance Method Summary collapse
- #class_names(*args) ⇒ Object
- #dom_class(record_or_class, prefix = nil) ⇒ Object
- #dom_id(record_or_class, prefix = nil) ⇒ Object
- #excerpt(text, phrase, options = {}) ⇒ Object
- #highlight(text, phrases, options = {}, &block) ⇒ Object
- #pluralize(count, singular, plural_arg = nil, plural: plural_arg, locale: ::I18n.locale) ⇒ Object
- #simple_format(text, html_options = {}, options = {}) ⇒ Object
- #token_list(*args) ⇒ Object
- #truncate(text, options = {}, &block) ⇒ Object
- #word_wrap(text, line_width: 80, break_sequence: "\n") ⇒ Object
Instance Method Details
#class_names(*args) ⇒ Object
38 39 40 |
# File 'lib/typed_view_model/helpers/text_helpers.rb', line 38 def class_names(*args) helpers.class_names(*args) end |
#dom_class(record_or_class, prefix = nil) ⇒ Object
30 31 32 |
# File 'lib/typed_view_model/helpers/text_helpers.rb', line 30 def dom_class(record_or_class, prefix = nil) helpers.dom_class(record_or_class, prefix) end |
#dom_id(record_or_class, prefix = nil) ⇒ Object
34 35 36 |
# File 'lib/typed_view_model/helpers/text_helpers.rb', line 34 def dom_id(record_or_class, prefix = nil) helpers.dom_id(record_or_class, prefix) end |
#excerpt(text, phrase, options = {}) ⇒ Object
18 19 20 |
# File 'lib/typed_view_model/helpers/text_helpers.rb', line 18 def excerpt(text, phrase, = {}) helpers.excerpt(text, phrase, ) end |
#highlight(text, phrases, options = {}, &block) ⇒ Object
22 23 24 |
# File 'lib/typed_view_model/helpers/text_helpers.rb', line 22 def highlight(text, phrases, = {}, &block) helpers.highlight(text, phrases, , &block) end |
#pluralize(count, singular, plural_arg = nil, plural: plural_arg, locale: ::I18n.locale) ⇒ Object
10 11 12 |
# File 'lib/typed_view_model/helpers/text_helpers.rb', line 10 def pluralize(count, singular, plural_arg = nil, plural: plural_arg, locale: ::I18n.locale) helpers.pluralize(count, singular, plural_arg, plural: plural, locale: locale) end |
#simple_format(text, html_options = {}, options = {}) ⇒ Object
14 15 16 |
# File 'lib/typed_view_model/helpers/text_helpers.rb', line 14 def simple_format(text, = {}, = {}) helpers.simple_format(text, , ) end |
#token_list(*args) ⇒ Object
42 43 44 |
# File 'lib/typed_view_model/helpers/text_helpers.rb', line 42 def token_list(*args) helpers.token_list(*args) end |
#truncate(text, options = {}, &block) ⇒ Object
6 7 8 |
# File 'lib/typed_view_model/helpers/text_helpers.rb', line 6 def truncate(text, = {}, &block) helpers.truncate(text, , &block) end |
#word_wrap(text, line_width: 80, break_sequence: "\n") ⇒ Object
26 27 28 |
# File 'lib/typed_view_model/helpers/text_helpers.rb', line 26 def word_wrap(text, line_width: 80, break_sequence: "\n") helpers.word_wrap(text, line_width: line_width, break_sequence: break_sequence) end |