Class: WcoHosting::Appliance
- Inherits:
-
Object
- Object
- WcoHosting::Appliance
- 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
- #environment_name ⇒ Object
- #host ⇒ Object
- #rc ⇒ Object
-
#slug ⇒ Object
field :slug, type: String.
- #tmpl ⇒ Object
- #to_s ⇒ Object
Methods included from Wco::Utils
Instance Method Details
#environment_name ⇒ Object
28 29 30 |
# File 'app/models/wco_hosting/appliance.rb', line 28 def environment_name environment&.name end |
#host ⇒ Object
34 35 36 |
# File 'app/models/wco_hosting/appliance.rb', line 34 def host "#{subdomain}.#{domain.name}" end |
#rc ⇒ Object
18 19 20 |
# File 'app/models/wco_hosting/appliance.rb', line 18 def rc OpenStruct.new JSON.parse rc_json end |
#slug ⇒ Object
field :slug, type: String
10 11 12 |
# File 'app/models/wco_hosting/appliance.rb', line 10 def slug "#{subdomain}_#{domain.name.gsub('.', '_')}" end |
#tmpl ⇒ Object
41 42 43 |
# File 'app/models/wco_hosting/appliance.rb', line 41 def tmpl appliance_tmpl end |
#to_s ⇒ Object
57 58 59 |
# File 'app/models/wco_hosting/appliance.rb', line 57 def to_s appliance_tmpl # kind end |