Imagine, you have 3 machines - 1 chef-workstation, chef-server and 1 client which is configured.
So, I need to extract client's IP-address from configfiles/processes/etc on a chef-server or vice versa:
extract server's IP-address on chef-client machine(node).
(that means, that I can't use workstation for extracting IP-address).
On the chef workstation, get the nodes ipaddress with knife:
knife search node '*' -a ipaddress
And get the chef server ip by resolving its host name with dns, getting the chef server hostname from the knife.rb file eventually...
I don't get the point of tagging your question with ruby if you don't want to use it...