Class: ActionPack::Cloudfront::IpRanges::Range

Inherits:
Object
  • Object
show all
Defined in:
lib/action_pack/cloudfront/ip_ranges.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ Range

Returns a new instance of Range.



8
9
10
11
12
# File 'lib/action_pack/cloudfront/ip_ranges.rb', line 8

def initialize(attrs)
  @service = attrs['service']
  @ip_prefix = attrs['ip_prefix'] || attrs['ipv6_prefix']
  @region = attrs['region']
end

Instance Attribute Details

#ip_prefixObject (readonly)

Returns the value of attribute ip_prefix.



6
7
8
# File 'lib/action_pack/cloudfront/ip_ranges.rb', line 6

def ip_prefix
  @ip_prefix
end

#regionObject (readonly)

Returns the value of attribute region.



6
7
8
# File 'lib/action_pack/cloudfront/ip_ranges.rb', line 6

def region
  @region
end

#serviceObject (readonly)

Returns the value of attribute service.



6
7
8
# File 'lib/action_pack/cloudfront/ip_ranges.rb', line 6

def service
  @service
end

Instance Method Details

#cloudfront?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/action_pack/cloudfront/ip_ranges.rb', line 14

def cloudfront?
  service =~ /cloudfront/i
end

#ipaddrObject



18
19
20
# File 'lib/action_pack/cloudfront/ip_ranges.rb', line 18

def ipaddr
  IPAddr.new(ip_prefix)
end