Extract legal doc parsing away from Epp::Domain class

This commit is contained in:
Maciej Szlosarczyk 2020-06-05 09:56:30 +03:00
parent 67cfe76f0a
commit 043037225b
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
5 changed files with 99 additions and 21 deletions

View file

@ -0,0 +1,22 @@
module Deserializers
module Xml
# Given a nokogiri frame, extract information about legal document from it.
class LegalDocument
attr_reader :frame
def initialize(frame)
@frame = frame
end
def call
ld = frame.css('legalDocument').first
return unless ld
{
body: ld.text,
type: ld['type']
}
end
end
end
end