Class: WcoHosting::Appliance
- Inherits:
-
Object
- Object
- WcoHosting::Appliance
- 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
- #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
27 28 29 |
# File 'app/models/wco_hosting/appliance.rb', line 27 def environment_name environment&.name end |
#host ⇒ Object
33 34 35 |
# File 'app/models/wco_hosting/appliance.rb', line 33 def host "#{subdomain}.#{domain.name}" end |
#rc ⇒ Object
17 18 19 |
# File 'app/models/wco_hosting/appliance.rb', line 17 def rc OpenStruct.new JSON.parse rc_json end |
#slug ⇒ Object
field :slug, type: String
9 10 11 |
# File 'app/models/wco_hosting/appliance.rb', line 9 def slug "#{subdomain}_#{domain.name.gsub('.', '_')}" end |
#tmpl ⇒ Object
40 41 42 |
# File 'app/models/wco_hosting/appliance.rb', line 40 def tmpl appliance_tmpl end |
#to_s ⇒ Object
56 57 58 |
# File 'app/models/wco_hosting/appliance.rb', line 56 def to_s appliance_tmpl # kind end |