<commit_before>module Fog
  module DNS
    class Zerigo
      class Real

        require 'fog/zerigo/parsers/dns/list_zones'

        # Get list of all DNS zones hosted on Slicehost (for this account)
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'zones'<~Array>
        #       * 'default-ttl'<~Integer>
        #       * 'id'<~Integer>
        #       * 'nx-ttl'<~Integer>
        #       * 'hosts-count'<~Integer>
        #       * 'created-at'<~String>
        #       * 'custom-nameservers'<~String>
        #       * 'custom-ns'<~String>
        #       * 'domain'<~String>
        #       * 'hostmaster'<~String>
        #       * 'notes'<~String>
        #       * 'ns1'<~String>
        #       * 'ns-type'<~String>
        #       * 'slave-nameservers'<~String>
        #       * 'tag-list'<~String>
        #       * 'updated-at'<~String>
        #       * 'hosts'<~String>
        #       * 'axfr-ips'<~String>
        #       * 'restrict-axfr'<~String>    
        #   * 'status'<~Integer> - 200 indicates success
        def list_zones(options = {})
          parameters = {}
          options.each do |option, value|
            case option
            when :per_page
              parameters[:per_page] = value
            when :page
              parameters[:page] = value
            end
          end
          request(
            :query => parameters,
            :expects  => 200,
            :method   => 'GET',
            :parser   => Fog::Parsers::DNS::Zerigo::ListZones.new,
            :path     => '/api/1.1/zones.xml'
          )
        end

      end

      class Mock # :nodoc:all

        def list_zones
          response = Excon::Response.new

          response.status = 200
          response.body = {
            'zones' => self.data[:zones]
          }

          response
        end
<commit_msg>Simplify Zerigo DNS list_zones request.<commit_after>module Fog
  module DNS
    class Zerigo
      class Real

        require 'fog/zerigo/parsers/dns/list_zones'

        # Get list of all DNS zones hosted on Slicehost (for this account)
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'zones'<~Array>
        #       * 'default-ttl'<~Integer>
        #       * 'id'<~Integer>
        #       * 'nx-ttl'<~Integer>
        #       * 'hosts-count'<~Integer>
        #       * 'created-at'<~String>
        #       * 'custom-nameservers'<~String>
        #       * 'custom-ns'<~String>
        #       * 'domain'<~String>
        #       * 'hostmaster'<~String>
        #       * 'notes'<~String>
        #       * 'ns1'<~String>
        #       * 'ns-type'<~String>
        #       * 'slave-nameservers'<~String>
        #       * 'tag-list'<~String>
        #       * 'updated-at'<~String>
        #       * 'hosts'<~String>
        #       * 'axfr-ips'<~String>
        #       * 'restrict-axfr'<~String>    
        #   * 'status'<~Integer> - 200 indicates success
        def list_zones(options = {})
          request(
            :query => options,
            :expects  => 200,
            :method   => 'GET',
            :parser   => Fog::Parsers::DNS::Zerigo::ListZones.new,
            :path     => '/api/1.1/zones.xml'
          )
        end

      end

      class Mock # :nodoc:all

        def list_zones
          response = Excon::Response.new

          response.status = 200
          response.body = {
            'zones' => self.data[:zones]
          }

          response
        end

{'fraction_non_alphanumeric': 0.14457158805470277, 'fraction_numerical': 0.0066982975160480044, 'mean_word_length': 1.3063063063063063, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3387836', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1135, 'n_words': 175}