mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 12:47:29 +02:00
Merge remote-tracking branch 'origin/master' into registrant-api-fetch-improvements
This commit is contained in:
commit
3761fe7bbd
97 changed files with 2824 additions and 821 deletions
BIN
lib/serializers/registrant_api/.DS_Store
vendored
Normal file
BIN
lib/serializers/registrant_api/.DS_Store
vendored
Normal file
Binary file not shown.
36
lib/serializers/repp/contact.rb
Normal file
36
lib/serializers/repp/contact.rb
Normal file
|
@ -0,0 +1,36 @@
|
|||
module Serializers
|
||||
module Repp
|
||||
class Contact
|
||||
attr_reader :contact
|
||||
|
||||
def initialize(contact, show_address:)
|
||||
@contact = contact
|
||||
@show_address = show_address
|
||||
end
|
||||
|
||||
def to_json(obj = contact)
|
||||
json = { id: obj.code, name: obj.name, ident: ident,
|
||||
email: obj.email, phone: obj.phone, fax: obj.fax,
|
||||
auth_info: obj.auth_info, statuses: obj.statuses,
|
||||
disclosed_attributes: obj.disclosed_attributes }
|
||||
|
||||
json[:address] = address if @show_address
|
||||
|
||||
json
|
||||
end
|
||||
|
||||
def ident
|
||||
{
|
||||
code: contact.ident,
|
||||
type: contact.ident_type,
|
||||
country_code: contact.ident_country_code,
|
||||
}
|
||||
end
|
||||
|
||||
def address
|
||||
{ street: contact.street, zip: contact.zip, city: contact.city,
|
||||
state: contact.state, country_code: contact.country_code }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue