mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Move to new serializer
This commit is contained in:
parent
cba445ee5b
commit
d005a61888
3 changed files with 78 additions and 33 deletions
|
@ -24,6 +24,10 @@ module Deserializers
|
|||
|
||||
# Auth info
|
||||
auth_info: if_present('authInfo pw'),
|
||||
|
||||
# statuses
|
||||
statuses_to_add: statuses_to_add,
|
||||
statuses_to_remove: statuses_to_remove,
|
||||
}
|
||||
|
||||
attributes.compact
|
||||
|
@ -34,6 +38,24 @@ module Deserializers
|
|||
|
||||
frame.css(css_path).text
|
||||
end
|
||||
|
||||
def statuses_to_add
|
||||
statuses_frame = frame.css('add')
|
||||
return unless statuses_frame.present?
|
||||
|
||||
statuses_frame.css('status').map do |status|
|
||||
status['s']
|
||||
end
|
||||
end
|
||||
|
||||
def statuses_to_remove
|
||||
statuses_frame = frame.css('rem')
|
||||
return unless statuses_frame.present?
|
||||
|
||||
statuses_frame.css('status').map do |status|
|
||||
status['s']
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue