Sha256: 7876cd3cb711a8f05031aeb1658256931f9a13ab690ee0a17dcb73102a9b5773

Contents?: true

Size: 764 Bytes

Versions: 2

Compression:

Stored size: 764 Bytes

Contents

# frozen_string_literal: true

require 'cloud_party/context'
require 'cloud_party/responses'
module CloudParty
  module Nodes
    class Memberships < 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)
        super()
        @options = options
      end

      def list
        CloudParty::Responses::Memberships.new(:get, '/memberships', self.class.get('/memberships', @options))
      rescue APIError => e
        puts e.message
        puts e.response
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cloud_party-0.1.1.pre.alpha.1 lib/cloud_party/nodes/memberships.rb
cloud_party-0.1.0.pre.pre.1 lib/cloud_party/nodes/memberships.rb