Class: TwistlockControl::Entities::Service
- Inherits:
-
PersistedEntity
- Object
- TwistlockControl::Entity
- PersistedEntity
- TwistlockControl::Entities::Service
- Defined in:
- lib/twistlock_control/entities/service.rb
Overview
A Service class describes a provisionable network service.
Direct Known Subclasses
Class Method Summary collapse
Methods inherited from PersistedEntity
all, find_by_id, find_with_ids, inherited, #remove, #repository, #save
Methods inherited from TwistlockControl::Entity
Class Method Details
.deserialize(attrs) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/twistlock_control/entities/service.rb', line 7 def self.deserialize(attrs) return nil if attrs.nil? case attrs['service_type'] when 'container' then Container.new(attrs) when 'composite' then CompositeService.new(attrs) else fail "Unknown service_type: #{attrs[:service_type]}" end end |