diff --git a/lib/whois/answer.rb b/lib/whois/answer.rb index c6f46c690..4046468db 100644 --- a/lib/whois/answer.rb +++ b/lib/whois/answer.rb @@ -199,15 +199,16 @@ def contacts parser.contacts end + # Checks whether this is a throttle response. # # @return [Boolean] # # @see Whois::Answer::Parser#throttle? # - def throttle? - parser.throttle? - end + # def throttle? + # parser.throttle? + # end private diff --git a/lib/whois/answer/parser.rb b/lib/whois/answer/parser.rb index 1c09deb69..f2361b561 100644 --- a/lib/whois/answer/parser.rb +++ b/lib/whois/answer/parser.rb @@ -106,8 +106,7 @@ def unchanged?(other) end equal?(other) || - parsers.size == other.parsers.size && - all_with_args?(parsers, other.parsers) { |one, two| one.unchanged?(two) } + parsers.size == other.parsers.size && all_with_args?(parsers, other.parsers) { |one, two| one.unchanged?(two) } end # Collects and returns all the contacts from all the answer parts. @@ -121,6 +120,7 @@ def contacts parsers.inject([]) { |all, parser| all.concat(parser.contacts) } end + # Loop through all the answer parts to check if at least # one part is a throttle response. # @@ -129,9 +129,9 @@ def contacts # @see Whois::Answer#throttle? # @see Whois::Answer::Parser::Base#throttle? # - def throttle? - parsers.any?(&:throttle?) - end + # def throttle? + # parsers.any?(&:throttle?) + # end private diff --git a/lib/whois/answer/parser/base.rb b/lib/whois/answer/parser/base.rb index 26615cfbd..3a16e0f30 100644 --- a/lib/whois/answer/parser/base.rb +++ b/lib/whois/answer/parser/base.rb @@ -278,6 +278,7 @@ def contacts contacts.compact end + # Checks whether this is a throttle response. # The default implementation always returns +nil+. # @@ -293,10 +294,6 @@ def throttle? end - - - - protected def content_for_scanner diff --git a/spec/whois/answer/parser_spec.rb b/spec/whois/answer/parser_spec.rb index a4579c583..75007efa3 100644 --- a/spec/whois/answer/parser_spec.rb +++ b/spec/whois/answer/parser_spec.rb @@ -164,6 +164,12 @@ class Whois::Answer::Parser::ParserUnsupportedTest < Whois::Answer::Parser::Base end + # describe "#throttle?" do + # it "" do + # end + # end + + describe ".parser_klass" do it "returns the parser hostname converted into a class" do require 'whois/answer/parser/whois.crsnic.net' diff --git a/spec/whois/answer_spec.rb b/spec/whois/answer_spec.rb index e7c505155..0147184c9 100644 --- a/spec/whois/answer_spec.rb +++ b/spec/whois/answer_spec.rb @@ -304,14 +304,15 @@ class Whois::Answer::Parser::WhoisPropertiesTest < Whois::Answer::Parser::Base end end - describe "#throttle?" do - it "delegates to #parser" do - instance = klass.new(nil, @parts) - instance.parser.expects(:throttle?) - instance.throttle? - end - end + # describe "#throttle?" do + # it "delegates to #parser" do + # i = klass.new(nil, @parts) + # i.parser.expects(:throttle?) + # + # i.throttle? + # end + # end describe "method_missing" do