def scan
      # start with the platform/families who have no families (the top levels)
      top = Train::Platforms.top_platforms
      top.each do |_name, plat|
        # we are doing a instance_eval here to make sure we have the proper
        # context with all the detect helper methods
        next unless instance_eval(&plat.detect) == true

        # if we have a match start looking at the children
        plat_result = scan_children(plat)
        next if plat_result.nil?

        # return platform to backend
        @family_hierarchy << plat.name
        return get_platform(plat_result)
      end

      fail Train::PlatformDetectionFailed, 'Sorry, we are unable to detect your platform'
    end
def scan
      # start with the platform/families who have no families (the top levels)
      top = Train::Platforms.top_platforms
      top.each do |_name, plat|
        # we are doing a instance_eval here to make sure we have the proper
        # context with all the detect helper methods
        next unless instance_eval(&plat.detect) == true

        # if we have a match start looking at the children
        plat_result = scan_children(plat)
        next if plat_result.nil?

        # return platform to backend
        @family_hierarchy << plat.name
        return get_platform(plat_result)
      end

      fail Train::PlatformDetectionFailed, 'Sorry, we are unable to detect your platform'
    end
Main detect method to scan all platforms for a match

 @return Train::Platform instance or error if none found