internetee-registry/app/presenters/registrant_presenter.rb
2017-05-22 12:42:10 +03:00

30 lines
600 B
Ruby

class RegistrantPresenter
delegate :name,
:ident,
:phone,
:email,
:priv?,
:id_code,
:reg_no,
:street, :city, :state, :zip, :country,
:ident_country,
to: :registrant
def initialize(registrant:, view:)
@registrant = registrant
@view = view
end
def country(locale: I18n.locale)
registrant.country.translation(locale)
end
def ident_country(locale: I18n.locale)
registrant.ident_country.translation(locale)
end
private
attr_reader :registrant
attr_reader :view
end