lib/nmap/os.rb in ruby-nmap-0.5.1 vs lib/nmap/os.rb in ruby-nmap-0.6.0

- old
+ new

@@ -1,9 +1,12 @@ require 'nmap/os_class' require 'nmap/os_match' module Nmap + # + # Wraps the `os` XML element. + # class OS include Enumerable # @@ -36,11 +39,11 @@ # @return [OS, Enumerator] # The OS information. If no block was given, an enumerator object # will be returned. # def each_class - return enum_for(:each_class) unless block_given? + return enum_for(__method__) unless block_given? @node.xpath("osclass").map do |osclass| os_class = OSClass.new( osclass['type'].to_sym, osclass['vendor'], @@ -76,10 +79,10 @@ # @return [OS, Enumerator] # The OS information. If no block was given, an enumerator object # will be returned. # def each_match - return enum_for(:each_match) unless block_given? + return enum_for(__method__) unless block_given? @node.xpath("osmatch").map do |osclass| os_match = OSMatch.new( osclass['name'], osclass['accuracy'].to_i