Class: WcoHosting::Appliance

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Paranoia, 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



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

def environment_name
  environment&.name
end

#hostObject



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

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

#rcObject



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

def rc
  OpenStruct.new JSON.parse rc_json
end

#slugObject

field :slug, type: String



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

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

#tmplObject



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

def tmpl
  appliance_tmpl
end

#to_sObject



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

def to_s
  appliance_tmpl # kind
end