Module: Convection::Model::Mixin::Protocol

Included in:
Template::Resource::EC2NetworkACLEntry, Template::Resource::EC2SecurityGroupIngres
Defined in:
lib/convection/model/mixin/protocol.rb

Overview

Map IP protocol names to numbers

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.lookup(value) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/convection/model/mixin/protocol.rb', line 11

def lookup(value)
  case value
  when :any then -1
  when :icmp then 1
  when :tcp then 6
  when :udp then 17
  else value
  end
end

Instance Method Details

#protocol_property(name = :protocol, property_name = 'IpProtocol') ⇒ Object



22
23
24
25
# File 'lib/convection/model/mixin/protocol.rb', line 22

def protocol_property(name = :protocol, property_name = 'IpProtocol')
  property(name, property_name,
           :transform => Mixin::Protocol.method(:lookup))
end