def health_checks(options = {})
      check_list = {}

      is_truncated = true
      next_marker = nil

      while is_truncated
        opts = next_marker ? {:marker => next_marker} : {}
        response = @route53.list_health_checks(opts)

        response[:health_checks].each do |check|
          check_list[check[:id]] = check[:health_check_config]
        end

        is_truncated = response[:is_truncated]
        next_marker = response[:next_marker]
      end

      if options[:extended]
        check_list.instance_variable_set(:@route53, @route53)

        def check_list.find_or_create(attrs)
          health_check_id, config = self.find {|hcid, elems| elems == attrs }

          unless health_check_id
            if attrs[:child_health_checks] and attrs[:child_health_checks].empty?
              attrs[:child_health_checks] = nil
            end

            if attrs[:regions] and attrs[:regions].empty?
              attrs[:regions] = nil
            end

            response = @route53.create_health_check({
              :caller_reference    => "roadworker #{Roadworker::VERSION} #{UUID.new.generate}",
              :health_check_config => attrs,
            })

            health_check_id = response[:health_check][:id]
            config = response[:health_check][:health_check_config]
            self[health_check_id] = config
          end

          return health_check_id
        end
      end

      return check_list
    end
def health_checks(options = {})
      check_list = {}

      is_truncated = true
      next_marker = nil

      while is_truncated
        opts = next_marker ? {:marker => next_marker} : {}
        response = @route53.list_health_checks(opts)

        response[:health_checks].each do |check|
          check_list[check[:id]] = check[:health_check_config]
        end

        is_truncated = response[:is_truncated]
        next_marker = response[:next_marker]
      end

      if options[:extended]
        check_list.instance_variable_set(:@route53, @route53)

        def check_list.find_or_create(attrs)
          health_check_id, config = self.find {|hcid, elems| elems == attrs }

          unless health_check_id
            if attrs[:child_health_checks] and attrs[:child_health_checks].empty?
              attrs[:child_health_checks] = nil
            end

            if attrs[:regions] and attrs[:regions].empty?
              attrs[:regions] = nil
            end

            response = @route53.create_health_check({
              :caller_reference    => "roadworker #{Roadworker::VERSION} #{UUID.new.generate}",
              :health_check_config => attrs,
            })

            health_check_id = response[:health_check][:id]
            config = response[:health_check][:health_check_config]
            self[health_check_id] = config
          end

          return health_check_id
        end
      end

      return check_list
    end
of class method