Sha256: 82fd5c3914547b54239edb27826e7c8c9fa68a37654451c4043d370ea8a83b7c

Contents?: true

Size: 611 Bytes

Versions: 5

Compression:

Stored size: 611 Bytes

Contents

# frozen_string_literal: true

require_relative "base"

module Neetob
  class CLI
    module Cloudflare
      class AlwaysUseHttps < Base
        attr_accessor :domain

        def initialize(domain)
          super()
          @domain = domain
        end

        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/always_use_https")
          response = get(url)
          ui.info("Always use HTTPS is turned #{response[:result][:value]}")
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
neetob-0.4.36 lib/neetob/cli/cloudflare/always_use_https.rb
neetob-0.4.35 lib/neetob/cli/cloudflare/always_use_https.rb
neetob-0.4.34 lib/neetob/cli/cloudflare/always_use_https.rb
neetob-0.4.33 lib/neetob/cli/cloudflare/always_use_https.rb
neetob-0.4.32 lib/neetob/cli/cloudflare/always_use_https.rb