Class: Neetob::CLI::Cloudflare::MinTlsVersion
- Defined in:
- lib/neetob/cli/cloudflare/min_tls_version.rb
Constant Summary
Constants inherited from Base
Base::NEETO_DEPLOY_DOCS, Base::ZONE_IDS
Constants inherited from Base
Instance Attribute Summary collapse
-
#domain ⇒ Object
Returns the value of attribute domain.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(domain) ⇒ MinTlsVersion
constructor
A new instance of MinTlsVersion.
- #run ⇒ Object
Methods inherited from Base
Methods included from Utils
#camel_case_to_slug, #is_upper?, #symbolize_keys
Constructor Details
#initialize(domain) ⇒ MinTlsVersion
Returns a new instance of MinTlsVersion.
11 12 13 14 |
# File 'lib/neetob/cli/cloudflare/min_tls_version.rb', line 11 def initialize(domain) super() @domain = domain end |
Instance Attribute Details
#domain ⇒ Object
Returns the value of attribute domain.
9 10 11 |
# File 'lib/neetob/cli/cloudflare/min_tls_version.rb', line 9 def domain @domain end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/neetob/cli/cloudflare/min_tls_version.rb', line 16 def run zone_id = ZONE_IDS[domain.to_sym] raise(StandardError, "Domain '#{domain}' not found.") if zone_id.nil? url = create_url(zone_id, "settings/min_tls_version") response = get(url) tls_version = response[:result][:value] == "1.2" ? print_success(response[:result][:value]) : print_failure(response[:result][:value]) ui.info("Minimum TLS version is set to #{tls_version}") end |