Merge pull request #288 from internetee/various-improvements

Various improvements
This commit is contained in:
Timo Võhmar 2016-12-13 11:45:42 +02:00 committed by GitHub
commit f6522dd62c
4 changed files with 30 additions and 2 deletions

View file

@ -1,11 +1,19 @@
class DomainPresenter
delegate :name, :registrant_name, to: :domain
delegate :name, :registrant_name, :registrant_id, to: :domain
def initialize(domain:, view:)
@domain = domain
@view = view
end
def expire_time
view.l(domain.expire_time)
end
def expire_date
view.l(domain.expire_time, format: :date)
end
def on_hold_date
view.l(domain.on_hold_time, format: :date) if domain.on_hold_time
end