Remodeled ident type to parsed_frame

This commit is contained in:
Andres Keskküla 2015-01-08 11:37:20 +02:00
parent b934850ba7
commit 1dd11405f6
4 changed files with 9 additions and 3 deletions

View file

@ -168,8 +168,7 @@ module Epp::ContactsHelper
end
def ident_type
result = params[:frame].slice(/(?<=\<ns2:ident type=)(.*)(?=<)/)
result = parsed_frame.css('ident').first.try(:attributes).try(:[], 'flag').try(:value)
return nil unless result
Contact::IDENT_TYPES.any? { |type| return type if result.include?(type) }