Sha256: e99d27141ee4113429a17c7992ef60e5255357a18318bcd8540f1fc9bb79db2a

Contents?: true

Size: 693 Bytes

Versions: 3

Compression:

Stored size: 693 Bytes

Contents

module Smartdc
  module Configure
    class << self
      def attributes
        @attributes ||= %i[
          url version ssl_verify middleware
          username use_key rsa_path
        ]
      end

      def setup
        attributes.each do |attribute|
          if Smartdc::Default.respond_to?(attribute)
            instance_variable_set(:"@#{attribute}", Smartdc::Default.send(attribute))
          end
        end
      end

      def options
        Hash[
          Smartdc::Configure.attributes.map do |attribute|
            [attribute, instance_variable_get(:"@#{attribute}")]
          end
        ]
      end

      attr_accessor *Smartdc::Configure.attributes
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
smartdc-2.0.2 lib/smartdc/configure.rb
smartdc-2.0.1 lib/smartdc/configure.rb
smartdc-2.0.0 lib/smartdc/configure.rb