Refactor domain expiration email

#186
This commit is contained in:
Artur Beljajev 2016-10-28 00:36:12 +03:00
parent 39d7c6ad1d
commit ad0220088a
30 changed files with 697 additions and 59 deletions

View file

@ -0,0 +1,33 @@
class DomainPresenter
delegate :name, :registrant_name, to: :domain
def initialize(domain:, view:)
@domain = domain
@view = view
end
def on_hold_date
view.l(domain.on_hold_time, format: :date) if domain.on_hold_time
end
def delete_date
view.l(domain.delete_time, format: :date) if domain.delete_time
end
def admin_contact_names
domain.admin_contact_names.join(', ')
end
def tech_contact_names
domain.tech_contact_names.join(', ')
end
def nameserver_names
domain.nameserver_hostnames.join(', ')
end
private
attr_reader :domain
attr_reader :view
end