Class: ActionPack::Cloudfront::IpRanges::Range
- Inherits:
-
Object
- Object
- ActionPack::Cloudfront::IpRanges::Range
- Defined in:
- lib/action_pack/cloudfront/ip_ranges.rb
Instance Attribute Summary collapse
-
#ip_prefix ⇒ Object
readonly
Returns the value of attribute ip_prefix.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
- #cloudfront? ⇒ Boolean
-
#initialize(attrs) ⇒ Range
constructor
A new instance of Range.
- #ipaddr ⇒ Object
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_prefix ⇒ Object (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 |
#region ⇒ Object (readonly)
Returns the value of attribute region.
6 7 8 |
# File 'lib/action_pack/cloudfront/ip_ranges.rb', line 6 def region @region end |
#service ⇒ Object (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
14 15 16 |
# File 'lib/action_pack/cloudfront/ip_ranges.rb', line 14 def cloudfront? service =~ /cloudfront/i end |
#ipaddr ⇒ Object
18 19 20 |
# File 'lib/action_pack/cloudfront/ip_ranges.rb', line 18 def ipaddr IPAddr.new(ip_prefix) end |