Sha256: bb4f158b028d9cb26850c12273c7edc761e302e78ecd199843ea96eecb6d0224

Contents?: true

Size: 812 Bytes

Versions: 2

Compression:

Stored size: 812 Bytes

Contents

# frozen_string_literal: true

require 'cloud_party/context'
require 'cloud_party/responses'
module CloudParty
  module Nodes
    class Zones
      include CloudParty::Context
      include HTTParty
      base_uri 'api.cloudflare.com:443/client/v4'
      headers 'X-Auth-Email' => cfg.email,
              'X-Auth-Key' => cfg.api_key,
              'Content-Type' => 'application/json',
              'User-Agent' => "CloudParty/#{CloudParty::VERSION}"

      def initialize(options = nil)
        super()
        @options = options
      end

      def list
        CloudParty::Responses::Zones.new(:get, '/zones', self.class.get('/zones'), @options)
      end

      def get(id)
        CloudParty::Responses::Zones.new(:get, '/zones/:id', self.class.get("/zones/#{id}"), @options)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cloud_party-0.1.2 lib/cloud_party/nodes/zones.rb
cloud_party-0.1.1 lib/cloud_party/nodes/zones.rb