Class: Cloudflare::CustomHostname::SSLAttribute

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudflare/custom_hostname/ssl_attribute.rb,
lib/cloudflare/custom_hostname/ssl_attribute/settings.rb

Defined Under Namespace

Classes: Settings

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ SSLAttribute

Returns a new instance of SSLAttribute.



8
9
10
# File 'lib/cloudflare/custom_hostname/ssl_attribute.rb', line 8

def initialize(params)
	@params = params
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/cloudflare/custom_hostname/ssl_attribute.rb', line 12

def active?
	status == 'active'
end

#cnameObject



16
17
18
# File 'lib/cloudflare/custom_hostname/ssl_attribute.rb', line 16

def cname
	@params[:cname]
end

#cname_targetObject



20
21
22
# File 'lib/cloudflare/custom_hostname/ssl_attribute.rb', line 20

def cname_target
	@params[:cname_target]
end

#http_bodyObject



24
25
26
# File 'lib/cloudflare/custom_hostname/ssl_attribute.rb', line 24

def http_body
	@params[:http_body]
end

#http_urlObject



28
29
30
# File 'lib/cloudflare/custom_hostname/ssl_attribute.rb', line 28

def http_url
	@params[:http_url]
end

#methodObject



32
33
34
# File 'lib/cloudflare/custom_hostname/ssl_attribute.rb', line 32

def method
	@params[:method]
end

#pending_validation?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/cloudflare/custom_hostname/ssl_attribute.rb', line 36

def pending_validation?
	status == 'pending_validation'
end

#settingsObject

Wraps the settings hash if it exists or initializes the settings hash and then wraps it



41
42
43
# File 'lib/cloudflare/custom_hostname/ssl_attribute.rb', line 41

def settings
	@settings ||= Settings.new(@params[:settings] ||= {})
end

#statusObject



45
46
47
# File 'lib/cloudflare/custom_hostname/ssl_attribute.rb', line 45

def status
	@params[:status]
end

#to_hObject



49
50
51
# File 'lib/cloudflare/custom_hostname/ssl_attribute.rb', line 49

def to_h
	@params
end

#typeObject



53
54
55
# File 'lib/cloudflare/custom_hostname/ssl_attribute.rb', line 53

def type
	@params[:type]
end

#validation_errorsObject



57
58
59
# File 'lib/cloudflare/custom_hostname/ssl_attribute.rb', line 57

def validation_errors
	@params[:validation_errors]
end