Class: Georgia::MessageDecorator
- Inherits:
-
ApplicationDecorator
- Object
- Draper::Decorator
- ApplicationDecorator
- Georgia::MessageDecorator
- Defined in:
- app/decorators/georgia/message_decorator.rb
Instance Method Summary collapse
- #message_truncated ⇒ Object
- #name_or_anonymous ⇒ Object
- #phone_or_none ⇒ Object
- #subject_truncated ⇒ Object
Instance Method Details
#message_truncated ⇒ Object
12 13 14 |
# File 'app/decorators/georgia/message_decorator.rb', line 12 def h.truncate(h.(), length: 200, separator: ' ').html_safe if .present? end |
#name_or_anonymous ⇒ Object
16 17 18 |
# File 'app/decorators/georgia/message_decorator.rb', line 16 def name_or_anonymous name || 'Anonymous' end |
#phone_or_none ⇒ Object
4 5 6 |
# File 'app/decorators/georgia/message_decorator.rb', line 4 def phone_or_none phone.present? ? phone : h.content_tag(:span, 'no phone', class: 'muted') end |
#subject_truncated ⇒ Object
8 9 10 |
# File 'app/decorators/georgia/message_decorator.rb', line 8 def subject_truncated h.truncate(h.(subject), length: 60, separator: ' ').html_safe if subject.present? end |