Class: Georgia::MessageDecorator

Inherits:
ApplicationDecorator show all
Defined in:
app/decorators/georgia/message_decorator.rb

Instance Method Summary collapse

Instance Method Details

#message_truncatedObject



12
13
14
# File 'app/decorators/georgia/message_decorator.rb', line 12

def message_truncated
  h.truncate(h.strip_tags(message), length: 200, separator: ' ').html_safe if message.present?
end

#name_or_anonymousObject



16
17
18
# File 'app/decorators/georgia/message_decorator.rb', line 16

def name_or_anonymous
  name || 'Anonymous'
end

#phone_or_noneObject



4
5
6
# File 'app/decorators/georgia/message_decorator.rb', line 4

def phone_or_none
  phone.present? ? phone : h.(:span, 'no phone', class: 'muted')
end

#subject_truncatedObject



8
9
10
# File 'app/decorators/georgia/message_decorator.rb', line 8

def subject_truncated
  h.truncate(h.strip_tags(subject), length: 60, separator: ' ').html_safe if subject.present?
end