Class: Flucti::Resources::PortForwarding

Inherits:
BasicResource
  • Object
show all
Defined in:
lib/flucti/resources/port_forwarding.rb

Instance Method Summary collapse

Methods inherited from BasicResource

#to_s, #vps, #vps=, #vps_id

Instance Method Details

#service_nameObject



6
7
8
9
10
11
12
# File 'lib/flucti/resources/port_forwarding.rb', line 6

def service_name
  matcher = %r{^(.+?) +#{to}/#{protocol.to_s.downcase}\b}
  IO.foreach(__FILE__.sub(/\.rb$/, '') + '/services') do |line|
    return $1.upcase if matcher =~ line
  end
  nil
end