mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
Extract legal doc parsing away from Epp::Domain class
This commit is contained in:
parent
67cfe76f0a
commit
043037225b
5 changed files with 99 additions and 21 deletions
22
lib/deserializers/xml/legal_document.rb
Normal file
22
lib/deserializers/xml/legal_document.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue