Class: Greenhouse::Resources::Procfile::Process

Inherits:
Object
  • Object
show all
Defined in:
lib/greenhouse/resources/procfile.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commandObject

Returns the value of attribute command.



50
51
52
# File 'lib/greenhouse/resources/procfile.rb', line 50

def command
  @command
end

#keyObject

Returns the value of attribute key.



50
51
52
# File 'lib/greenhouse/resources/procfile.rb', line 50

def key
  @key
end

#lineObject

Returns the value of attribute line.



50
51
52
# File 'lib/greenhouse/resources/procfile.rb', line 50

def line
  @line
end

Instance Method Details

#disableObject



64
65
66
# File 'lib/greenhouse/resources/procfile.rb', line 64

def disable
  @disabled = true
end

#disabled?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/greenhouse/resources/procfile.rb', line 56

def disabled?
  @disabled
end

#enableObject



60
61
62
# File 'lib/greenhouse/resources/procfile.rb', line 60

def enable
  @disabled = false
end

#enabled?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/greenhouse/resources/procfile.rb', line 52

def enabled?
  !@disabled
end

#inspectObject



72
73
74
# File 'lib/greenhouse/resources/procfile.rb', line 72

def inspect
  to_s
end

#to_sObject



68
69
70
# File 'lib/greenhouse/resources/procfile.rb', line 68

def to_s
  "#{"#" if disabled?}#{key}: #{command}"
end