Class: Cumuli::App::Procs::SubApp

Inherits:
Object
  • Object
show all
Defined in:
lib/cumuli/app/procs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line) ⇒ SubApp

Returns a new instance of SubApp.



35
36
37
# File 'lib/cumuli/app/procs.rb', line 35

def initialize(line)
  @parts = line.split
end

Instance Attribute Details

#partsObject (readonly)

Returns the value of attribute parts.



33
34
35
# File 'lib/cumuli/app/procs.rb', line 33

def parts
  @parts
end

Instance Method Details

#nameObject



39
40
41
# File 'lib/cumuli/app/procs.rb', line 39

def name
  parts.first.gsub(':', '')
end

#portObject



43
44
45
46
47
# File 'lib/cumuli/app/procs.rb', line 43

def port
  if index = parts.find_index('-p')
    parts[index + 1] && parts[index + 1].to_i
  end
end