Class: GoogleSslCert::Name
- Inherits:
-
Object
- Object
- GoogleSslCert::Name
- Extended by:
- Memoist
- Defined in:
- lib/google_ssl_cert/name.rb
Instance Method Summary collapse
- #base_name ⇒ Object
- #generated_name ⇒ Object
-
#initialize(options = {}) ⇒ Name
constructor
A new instance of Name.
Constructor Details
#initialize(options = {}) ⇒ Name
Returns a new instance of Name.
5 6 7 8 |
# File 'lib/google_ssl_cert/name.rb', line 5 def initialize(={}) @options = @append_type = @options[:append_type].nil? ? true : @options[:append_type] end |
Instance Method Details
#base_name ⇒ Object
16 17 18 19 |
# File 'lib/google_ssl_cert/name.rb', line 16 def base_name type = @options[:global] ? "global" : ENV['GOOGLE_REGION'] if @append_type [@options[:cert_name], type].compact.join('-') end |
#generated_name ⇒ Object
10 11 12 13 |
# File 'lib/google_ssl_cert/name.rb', line 10 def generated_name ts = Time.now.strftime("%Y%m%d%H%M%S") unless @options[:timestamp] == false # nil defaults to true [base_name, ts].compact.join('-') end |