1
0
mirror of https://github.com/cmur2/dyndnsd.git synced 2025-07-21 21:11:17 +02:00

daemon: break extracting myip down into smaller parts

This commit is contained in:
cn
2018-02-02 16:14:28 +01:00
parent 6080e14356
commit 08eaacb6ab
4 changed files with 53 additions and 59 deletions

View File

@ -34,9 +34,8 @@ module Dyndnsd
end
end
def get_success_body(states, ip)
ips = ip.is_a?(Array) ? ip.join(' ') : ip
states.map { |state| "#{state} #{ips}" }.join("\n")
def get_success_body(changes, myips)
changes.map { |change| "#{change} #{myips.join(' ')}" }.join("\n")
end
def get_error_response_map

View File

@ -34,10 +34,8 @@ module Dyndnsd
end
end
def get_success_response(states, ip)
ips = ip.is_a?(Array) ? ip.join(' ') : ip
states.map { |state| state == :good ? "Changed to #{ips}" : "No change needed for #{ips}" }.join("\n")
def get_success_body(changes, myips)
changes.map { |change| change == :good ? "Changed to #{myips.join(' ')}" : "No change needed for #{myips.join(' ')}" }.join("\n")
end
def get_error_response_map