mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
parent
39d7c6ad1d
commit
ad0220088a
30 changed files with 697 additions and 59 deletions
33
app/presenters/domain_presenter.rb
Normal file
33
app/presenters/domain_presenter.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue