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.



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

def initialize(params)
	@params = params
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


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

def active?
	status == "active"
end

#cnameObject



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

def cname
	@params[:cname]
end

#cname_targetObject



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

def cname_target
	@params[:cname_target]
end

#http_bodyObject



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

def http_body
	@params[:http_body]
end

#http_urlObject



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

def http_url
	@params[:http_url]
end

#methodObject



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

def method
	@params[:method]
end

#pending_validation?Boolean

Returns:

  • (Boolean)


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

def pending_validation?
	status == "pending_validation"
end

#settingsObject

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



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

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

#statusObject



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

def status
	@params[:status]
end

#to_hObject



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

def to_h
	@params
end

#typeObject



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

def type
	@params[:type]
end

#validation_errorsObject



62
63
64
# File 'lib/cloudflare/custom_hostname/ssl_attribute.rb', line 62

def validation_errors
	@params[:validation_errors]
end