Class: Orchestrator::Dependency
- Inherits:
-
Couchbase::Model
- Object
- Couchbase::Model
- Orchestrator::Dependency
- Includes:
- CouchbaseId::Generator
- Defined in:
- app/models/orchestrator/dependency.rb
Constant Summary collapse
- ROLES =
Set.new([:device, :service, :logic])
Instance Method Summary collapse
- #default_port=(port) ⇒ Object
- #default_uri=(uri) ⇒ Object
-
#modules ⇒ Object
Find the modules that rely on this dependency.
-
#role ⇒ Object
Override default role accessors.
- #role=(name) ⇒ Object
Instance Method Details
#default_port=(port) ⇒ Object
43 44 45 46 |
# File 'app/models/orchestrator/dependency.rb', line 43 def default_port=(port) self.role = :device self.default = port end |
#default_uri=(uri) ⇒ Object
48 49 50 51 |
# File 'app/models/orchestrator/dependency.rb', line 48 def default_uri=(uri) self.role = :service self.default = uri end |
#modules ⇒ Object
Find the modules that rely on this dependency
39 40 41 |
# File 'app/models/orchestrator/dependency.rb', line 39 def modules ::Orchestrator::Module.dependent_on(self.id) end |
#role ⇒ Object
Override default role accessors
23 24 25 |
# File 'app/models/orchestrator/dependency.rb', line 23 def role @role ||= self.attributes[:role].to_sym if self.attributes[:role] end |
#role=(name) ⇒ Object
26 27 28 29 |
# File 'app/models/orchestrator/dependency.rb', line 26 def role=(name) @role = name.to_sym self.attributes[:role] = name end |