Fix code climate offences

#569
This commit is contained in:
Artur Beljajev 2017-09-04 10:57:27 +03:00
parent dbf5c8b4aa
commit 7147144894
8 changed files with 38 additions and 18 deletions

View file

@ -48,9 +48,9 @@ class Contact < ActiveRecord::Base
composed_of :identifier,
class_name: 'Contact::Ident',
constructor: Proc.new { |code, type, country_code| Contact::Ident.new(code: code,
type: type,
country_code: country_code) },
constructor: proc { |code, type, country_code| Contact::Ident.new(code: code,
type: type,
country_code: country_code) },
mapping: [%w[ident code], %w[ident_type type], %w[ident_country_code country_code]]
def manage_emails

View file

@ -133,7 +133,7 @@ class Epp::Contact < Contact
],
'2305' => [ # Association exists
[:domains, :exist]
],
]
}
end
@ -165,8 +165,7 @@ class Epp::Contact < Contact
identifier = Ident.new(code: ident,
type: ident_frame.attr('type'),
country_code: ident_frame.attr('cc')
)
country_code: ident_frame.attr('cc'))
identifier.validate

View file

@ -4,7 +4,7 @@ module EPP
def self.from_xml(xml)
xml_doc = Nokogiri::XML(xml)
response = self.new
response = new
result_elements = xml_doc.css('result')

View file

@ -9,7 +9,7 @@ module EPP
'2001' => :syntax_error,
'2003' => :required_param_missing,
'2005' => :param_syntax_error,
'2308' => :data_management_policy_violation,
'2308' => :data_management_policy_violation
}
attr_accessor :code