Sha256: df3b2510a3ad2ca41b265d75ce8ab5778d876c43c86650ee10a20a631c18715a

Contents?: true

Size: 510 Bytes

Versions: 1

Compression:

Stored size: 510 Bytes

Contents

module GoogleSslCert
  class Name
    attr_reader :base_name
    def initialize(options={})
      @options = options
      @base_name = @options[:cert_name] || default_cert_name
    end

    def generate
      ts = Time.now.strftime("%Y%m%d%H%M%S") unless @options[:timestamp] == false # nil defaults to true
      [@base_name, ts].compact.join('-')
    end

    def default_cert_name
      type = @options[:global] ? "global" : ENV['GOOGLE_REGION']
      ["google-ssl-cert", type].join('-')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
google-ssl-cert-0.1.0 lib/google_ssl_cert/name.rb