mirror of
https://github.com/internetee/registry.git
synced 2025-06-04 11:47:30 +02:00
Split "big" method into two smaller ones
This commit is contained in:
parent
3aa978f722
commit
c7f95c41a2
1 changed files with 17 additions and 11 deletions
|
@ -63,17 +63,8 @@ class RetainedDomains
|
|||
end
|
||||
|
||||
def domain_to_jsonable(domain)
|
||||
status = case domain
|
||||
when ReservedDomain then RESERVED
|
||||
when BlockedDomain then BLOCKED
|
||||
when Dispute then DISPUTED
|
||||
end
|
||||
|
||||
domain_name = case domain
|
||||
when Dispute then domain.domain_name
|
||||
else domain.name
|
||||
end
|
||||
|
||||
status = get_status(domain)
|
||||
domain_name = get_domain_name(domain)
|
||||
punycode = SimpleIDN.to_ascii(domain_name)
|
||||
|
||||
{
|
||||
|
@ -82,4 +73,19 @@ class RetainedDomains
|
|||
punycode_name: punycode,
|
||||
}
|
||||
end
|
||||
|
||||
def get_status(domain)
|
||||
case domain
|
||||
when ReservedDomain then RESERVED
|
||||
when BlockedDomain then BLOCKED
|
||||
when Dispute then DISPUTED
|
||||
end
|
||||
end
|
||||
|
||||
def get_domain_name(domain)
|
||||
case domain
|
||||
when Dispute then domain.domain_name
|
||||
else domain.name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue