Sha256: b7325b4f575824d4c4ed769bb9a0de105c81a834c06009c785cc87a8ad17f3ef

Contents?: true

Size: 711 Bytes

Versions: 64

Compression:

Stored size: 711 Bytes

Contents

require 'aws-sdk'
require 'contracts'
require_relative 'support/rate_limit_handler'
require_relative '../config'

module Cloudstrap
  module Amazon
    class Service
      include ::Contracts::Core
      include ::Contracts::Builtin
      include Support::RateLimitHandler

      Contract Maybe[Config] => Service
      def initialize(config = nil)
        @config = config
        self
      end

      Contract None => Aws::Client
      def client
        raise NotImplementedError
      end

      Contract None => Aws::Client
      def api
        @api ||= client.new region: config.region
      end

      Contract None => Config
      def config
        @config ||= Config.new
      end
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
cloudstrap-0.33.1.pre lib/cloudstrap/amazon/service.rb
cloudstrap-0.32.5.pre lib/cloudstrap/amazon/service.rb
cloudstrap-0.31.1.pre lib/cloudstrap/amazon/service.rb
cloudstrap-0.30.12.pre lib/cloudstrap/amazon/service.rb