class Whois::Record::Parser::WhoisNicTr
Parser for the whois.nic.tr server.
@see Whois::Record::Parser::Example
The Example parser for the list of all available methods.
Public Instance Methods
invalid?()
click to toggle source
NEWPROPERTY invalid?
# File lib/whois/record/parser/whois.nic.tr.rb, line 123 def invalid? cached_properties_fetch :invalid? do response_error? end end
response_error?()
click to toggle source
# File lib/whois/record/parser/whois.nic.tr.rb, line 117 def response_error? content_for_scanner =~ /Invalid input/ end
Private Instance Methods
build_contact(element, type)
click to toggle source
# File lib/whois/record/parser/whois.nic.tr.rb, line 132 def build_contact(element, type) textblock = content_for_scanner.slice(/^\*\* #{element}:\n((?:.+\n)+)\n/, 1) return unless textblock lines = [] textblock.lines.each do |line| if line =~ /^\s+.+/ lines.last.last << "\n" << line.strip else lines << line.match(/([^\t]+)\t+:\s+(.+)/).to_a[1..2] end end lines = Hash[lines] Record::Contact.new( type: type, id: lines["NIC Handle"], name: lines["Person"], organization: lines["Organization Name"], address: lines["Address"], phone: lines["Phone"], fax: lines["Fax"] ) end