Class: DeviceAtlas::Carrier::CarrierData
- Inherits:
-
Object
- Object
- DeviceAtlas::Carrier::CarrierData
- Defined in:
- lib/deviceatlas/carrier/carrier_data.rb
Instance Attribute Summary collapse
-
#copyright ⇒ Object
readonly
Returns the value of attribute copyright.
-
#creation_date ⇒ Object
readonly
Returns the value of attribute creation_date.
-
#property_data_types ⇒ Object
readonly
Returns the value of attribute property_data_types.
-
#property_names ⇒ Object
readonly
Returns the value of attribute property_names.
-
#property_names_strings ⇒ Object
readonly
Returns the value of attribute property_names_strings.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
-
.ip_to_i(ip_str) ⇒ Integer
Returns the integer representation of an IP address passed as String.
Instance Method Summary collapse
-
#initialize ⇒ CarrierData
constructor
A new instance of CarrierData.
-
#load_data_from_file(file_path) ⇒ Object
Load carrier data file.
-
#properties(key) ⇒ Object
Selects a value for a given IP address, traversing tree and choosing most specific value available for a given address.
Constructor Details
#initialize ⇒ CarrierData
Returns a new instance of CarrierData.
Instance Attribute Details
#copyright ⇒ Object (readonly)
Returns the value of attribute copyright.
#creation_date ⇒ Object (readonly)
Returns the value of attribute creation_date.
#property_data_types ⇒ Object (readonly)
Returns the value of attribute property_data_types.
#property_names ⇒ Object (readonly)
Returns the value of attribute property_names.
#property_names_strings ⇒ Object (readonly)
Returns the value of attribute property_names_strings.
#version ⇒ Object (readonly)
Returns the value of attribute version.
Class Method Details
.ip_to_i(ip_str) ⇒ Integer
Returns the integer representation of an IP address passed as String.
Instance Method Details
#load_data_from_file(file_path) ⇒ Object
Load carrier data file.
file_path
-
carrier data file
#properties(key) ⇒ Object
Selects a value for a given IP address, traversing tree and choosing most specific value available for a given address.
key
-
IPv4/IPv6 address to look up in integer or string form
return
-
Value at most specific IPv4 network in a tree for a given IPv4
address