# File lib/whois/record/parser/whois.ua.rb, line 132 def build_contact(element, type) contact_ids = content.scan(/#{element}:\s+(.+)\n/).flatten return if contact_ids.empty? contact_ids.map do |contact_id| textblock = content.slice(/nic-handle:\s+#{contact_id}\n((?:.+\n)+)\n/, 1) address = textblock.scan(/address:\s+(.+)\n/).flatten zip = nil zip = address[1].slice!(/\s+\d{5}/).strip if address[1] =~ /\s+\d{5}/ zip = address[1].slice!(/\d{5}\s+/).strip if address[1] =~ /\d{5}\s+/ state = nil state = address[1].slice!(/\s+[A-Z]{2}\z/).strip if address[1] =~ /\s+[A-Z]{2}\z/ Record::Contact.new( type: type, id: contact_id, name: nil, organization: textblock.scan(/organization:\s+(.+)\n/).join("\n"), address: address[0], zip: zip, state: state, city: address[1], country: address[2], phone: textblock.slice(/phone:\s+(.+)\n/, 1), fax: textblock.slice(/fax-no:\s+(.+)\n/, 1), email: textblock.slice(/e-mail:\s+(.+)\n/, 1), updated_on: (Time.parse($1.split(" ").last) if textblock =~ /changed:\s+(.+)\n/) ) end end
# File lib/whois/record/parser/whois.ua.rb, line 110 def created_on if content =~ /created:\s+(.+)\n/ time = $1.split(" ").last Time.parse(time) end end
# File lib/whois/record/parser/whois.ua.rb, line 124 def expires_on if content =~ /status:\s+(.+)\n/ time = $1.split(" ").last Time.parse(time) end end
Generated with the Darkfish Rdoc Generator 2.