Class: DockerCompose::Generator::Service
- Inherits:
-
Object
- Object
- DockerCompose::Generator::Service
- Defined in:
- lib/docker-compose/generator/service.rb,
lib/docker-compose/generator/service/net.rb,
lib/docker-compose/generator/service/pid.rb,
lib/docker-compose/generator/service/links.rb,
lib/docker-compose/generator/service/ports.rb,
lib/docker-compose/generator/service/labels.rb,
lib/docker-compose/generator/service/volumes.rb,
lib/docker-compose/generator/service/environment.rb
Overview
Service Class
Used to interact with services
Defined Under Namespace
Modules: Environment, Labels, Links, Net, Pid, Ports, Volumes
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#import(attrs) ⇒ Object
Import the attrs hash.
-
#initialize(name, image) ⇒ Service
constructor
Initialize Method.
Methods included from Volumes
#add_volume, #drop_volume, #volume?
Methods included from Pid
Methods included from Net
Methods included from Labels
#add_label, #drop_label, #get_label, #label?
Methods included from Environment
#add_environment, #drop_environment, #environment?, #get_environment
Methods included from Links
#add_external_link, #add_link, #drop_external_link, #drop_link, #external_link?, #link?
Methods included from Ports
Constructor Details
#initialize(name, image) ⇒ Service
Initialize Method
39 40 41 42 43 44 |
# File 'lib/docker-compose/generator/service.rb', line 39 def initialize(name, image) @name = name @attrs = { 'image' => image } end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
30 31 32 |
# File 'lib/docker-compose/generator/service.rb', line 30 def attrs @attrs end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
30 31 32 |
# File 'lib/docker-compose/generator/service.rb', line 30 def name @name end |
Instance Method Details
#import(attrs) ⇒ Object
Import the attrs hash
86 87 88 |
# File 'lib/docker-compose/generator/service.rb', line 86 def import(attrs) @attrs = attrs end |