Class: WcoHosting::Appliance

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps, Wco::Utils
Defined in:
app/models/wco_hosting/appliance.rb

Constant Summary collapse

STATE_PENDING =
'pending'
STATE_LIVE =
'live'
STATE_TERMINATED =
'terminated'

Instance Method Summary collapse

Methods included from Wco::Utils

#export, included

Instance Method Details

#environment_nameObject



27
28
29
# File 'app/models/wco_hosting/appliance.rb', line 27

def environment_name
  environment&.name
end

#hostObject



33
34
35
# File 'app/models/wco_hosting/appliance.rb', line 33

def host
  "#{subdomain}.#{domain.name}"
end

#rcObject



17
18
19
# File 'app/models/wco_hosting/appliance.rb', line 17

def rc
  OpenStruct.new JSON.parse rc_json
end

#slugObject

field :slug, type: String



9
10
11
# File 'app/models/wco_hosting/appliance.rb', line 9

def slug
  "#{subdomain}_#{domain.name.gsub('.', '_')}"
end

#tmplObject



40
41
42
# File 'app/models/wco_hosting/appliance.rb', line 40

def tmpl
  appliance_tmpl
end

#to_sObject



56
57
58
# File 'app/models/wco_hosting/appliance.rb', line 56

def to_s
  appliance_tmpl # kind
end