Class: Greenhouse::Resources::Procfile::Process
- Inherits:
-
Object
- Object
- Greenhouse::Resources::Procfile::Process
- Defined in:
- lib/greenhouse/resources/procfile.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#key ⇒ Object
Returns the value of attribute key.
-
#line ⇒ Object
Returns the value of attribute line.
Instance Method Summary collapse
- #disable ⇒ Object
- #disabled? ⇒ Boolean
- #enable ⇒ Object
- #enabled? ⇒ Boolean
-
#initialize(key, command, line) ⇒ Process
constructor
A new instance of Process.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(key, command, line) ⇒ Process
Returns a new instance of Process.
76 77 78 79 80 81 |
# File 'lib/greenhouse/resources/procfile.rb', line 76 def initialize(key, command, line) @line = line @disabled = key.strip[0] == "#" @key = key.gsub(/\A#+/, "") @command = command end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
50 51 52 |
# File 'lib/greenhouse/resources/procfile.rb', line 50 def command @command end |
#key ⇒ Object
Returns the value of attribute key.
50 51 52 |
# File 'lib/greenhouse/resources/procfile.rb', line 50 def key @key end |
#line ⇒ Object
Returns the value of attribute line.
50 51 52 |
# File 'lib/greenhouse/resources/procfile.rb', line 50 def line @line end |
Instance Method Details
#disable ⇒ Object
64 65 66 |
# File 'lib/greenhouse/resources/procfile.rb', line 64 def disable @disabled = true end |
#disabled? ⇒ Boolean
56 57 58 |
# File 'lib/greenhouse/resources/procfile.rb', line 56 def disabled? @disabled end |
#enable ⇒ Object
60 61 62 |
# File 'lib/greenhouse/resources/procfile.rb', line 60 def enable @disabled = false end |
#enabled? ⇒ Boolean
52 53 54 |
# File 'lib/greenhouse/resources/procfile.rb', line 52 def enabled? !@disabled end |
#inspect ⇒ Object
72 73 74 |
# File 'lib/greenhouse/resources/procfile.rb', line 72 def inspect to_s end |
#to_s ⇒ Object
68 69 70 |
# File 'lib/greenhouse/resources/procfile.rb', line 68 def to_s "#{"#" if disabled?}#{key}: #{command}" end |