Class: DNApi::VHost

Inherits:
Struct
  • Object
show all
Defined in:
lib/dnapi/vhost.rb

Instance Attribute Summary collapse

Attributes inherited from Struct

#parent

Instance Method Summary collapse

Methods inherited from Struct

#==, _many, #_many, #_many_values, _ones, #_ones, #_ones_values, _umembers, belongs_to, from, #initialize, #inspect, many, map, one, #to_hash, #umember_inspect, unserialized_member

Methods included from Test::Ext

#default_fauxture_name, #fixture, #generate, #generate_attributes, #pick

Constructor Details

This class inherits a constructor from DNApi::Struct

Instance Attribute Details

#domain_nameObject

Returns the value of attribute domain_name

Returns:

  • (Object)

    the current value of domain_name



2
3
4
# File 'lib/dnapi/vhost.rb', line 2

def domain_name
  @domain_name
end

Instance Method Details

#build_ssl_cert(attributes = {}) ⇒ Object



10
11
12
13
14
# File 'lib/dnapi/vhost.rb', line 10

def build_ssl_cert(attributes = {})
  self.ssl_cert = SSLCert.new(attributes)
  self.ssl_cert.vhost = self
  self.ssl_cert
end

#https?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/dnapi/vhost.rb', line 6

def https?
  !ssl_cert.nil?
end

#to_legacy_hash(include_cert = false) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/dnapi/vhost.rb', line 16

def to_legacy_hash(include_cert = false)
  hash = {:role => app.environment.name, :name => domain_name}
  if include_cert
    hash.merge!(ssl_cert.to_legacy_hash)
  end
  hash
end