Class: Devup::ServiceDotenv
- Inherits:
-
Object
- Object
- Devup::ServiceDotenv
- Defined in:
- lib/devup/service_dotenv.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
-
#initialize(service, project: nil) ⇒ ServiceDotenv
constructor
A new instance of ServiceDotenv.
- #text ⇒ Object
Constructor Details
#initialize(service, project: nil) ⇒ ServiceDotenv
Returns a new instance of ServiceDotenv.
5 6 7 8 |
# File 'lib/devup/service_dotenv.rb', line 5 def initialize(service, project: nil) @service = service @project = project end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
3 4 5 |
# File 'lib/devup/service_dotenv.rb', line 3 def project @project end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
3 4 5 |
# File 'lib/devup/service_dotenv.rb', line 3 def service @service end |
Instance Method Details
#text ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/devup/service_dotenv.rb', line 10 def text res = [] res << "# #{service.name}" if has_ports? res << host_env res << ports_env else res << "# no exposed ports" end res.join "\n" end |