Module: Recruiter::PublicableDecoratorHelper
- Included in:
- ArticleDecorator, JobDecorator
- Defined in:
- lib/recruiter/publicable_decorator_helper.rb
Instance Method Summary collapse
- #created_at_ago ⇒ Object
- #publication ⇒ Object
- #published_at ⇒ Object
- #updated? ⇒ Boolean
- #updated_at ⇒ Object
- #updated_at_ago ⇒ Object
Instance Method Details
#created_at_ago ⇒ Object
3 4 5 |
# File 'lib/recruiter/publicable_decorator_helper.rb', line 3 def created_at_ago h.time_ago_in_words(object.created_at) end |
#publication ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/recruiter/publicable_decorator_helper.rb', line 23 def publication published_at.tap do |string| if updated? string << ' | ' << updated_at end end end |
#published_at ⇒ Object
15 16 17 |
# File 'lib/recruiter/publicable_decorator_helper.rb', line 15 def published_at h.t("recruiter.messages.published_at", time: created_at_ago) end |
#updated? ⇒ Boolean
11 12 13 |
# File 'lib/recruiter/publicable_decorator_helper.rb', line 11 def updated? updated_at_ago != created_at_ago end |
#updated_at ⇒ Object
19 20 21 |
# File 'lib/recruiter/publicable_decorator_helper.rb', line 19 def updated_at h.t("recruiter.messages.updated_at", time: updated_at_ago) end |
#updated_at_ago ⇒ Object
7 8 9 |
# File 'lib/recruiter/publicable_decorator_helper.rb', line 7 def updated_at_ago h.time_ago_in_words(object.created_at) end |