From 097b963bb15088912925b7da90eac05d0b6983cb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 5 Apr 2024 11:10:28 +0000 Subject: [PATCH] Deploy to GitHub pages --- 404.html | 127 +++ Ipapi.html | 213 +++++ Ipapi/AuthorizationFailedException.html | 272 ++++++ Ipapi/Client.html | 827 +++++++++++++++++ Ipapi/Error.html | 247 +++++ Ipapi/ErrorResponse.html | 352 ++++++++ Ipapi/Location.html | 808 +++++++++++++++++ Ipapi/PageNotFoundException.html | 272 ++++++ Ipapi/RateLimitedException.html | 272 ++++++ css/style.css | 980 ++++++++++++++++++++ index.html | 198 ++++ index.json | 1 + js/doc.js | 1099 +++++++++++++++++++++++ search-index.js | 1 + 14 files changed, 5669 insertions(+) create mode 100644 404.html create mode 100644 Ipapi.html create mode 100644 Ipapi/AuthorizationFailedException.html create mode 100644 Ipapi/Client.html create mode 100644 Ipapi/Error.html create mode 100644 Ipapi/ErrorResponse.html create mode 100644 Ipapi/Location.html create mode 100644 Ipapi/PageNotFoundException.html create mode 100644 Ipapi/RateLimitedException.html create mode 100644 css/style.css create mode 100644 index.html create mode 100644 index.json create mode 100644 js/doc.js create mode 100644 search-index.js diff --git a/404.html b/404.html new file mode 100644 index 0000000..687a032 --- /dev/null +++ b/404.html @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + ipapi-crystal 0.3.0 + + + + + + + + + + +
+

+ 404 Not Found +

+ +

+ This page is unavailable in this version of the API docs. +

+ +

+ You can use the sidebar to search for your page, or try a different + Crystal version. +

+ +
+ + diff --git a/Ipapi.html b/Ipapi.html new file mode 100644 index 0000000..f89fe35 --- /dev/null +++ b/Ipapi.html @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + Ipapi - ipapi-crystal 0.3.0 + + + + + + + + + + +
+

+ + module Ipapi + +

+ + + + + +

+ + + + Overview +

+ +

Crystal bindings for https://ipapi.co (IP Address Location & Geolocation API)

+

API Docs : https://ipapi.co/api/

+ + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + ipapi.cr + +
+ + + + + +

+ + + + Constant Summary +

+ +
+ +
+ FIELDS = {"ip" => "public (external) IP address (same as URL `ip`)", "city" => "city name", "region" => "region name (administrative division)", "region_code" => "region code", "country" => "country code (2 letter, ISO 3166-1 alpha-2)", "country_name" => "short country name", "continent_code" => "country code (2 letter, ISO 3166-1 alpha-2)", "in_eu" => "whether IP address belongs to a country that is a member of the European Union (EU)", "postal" => "postal code / zip code", "latitude" => "latitude", "longitude" => "longitude", "latlong" => "comma separated latitude and longitude", "timezone" => "timezone (IANA format i.e. “Area/Location”)", "utc_offset" => "UTC offset (with daylight saving time) as `+HHMM` or `-HHMM` (`HH` is hours, `MM` is minutes)", "languages" => "languages spoken (comma separated 2 or 3 letter ISO 639 code with optional hyphen separated country suffix)", "country_calling_code" => "country calling code (dial in code, comma separated)", "currency" => "currency code (ISO 4217)", "asn" => "autonomous system number", "org" => "organization name"} +
+ + +
+ VERSION = {{ (`shards version /__w/ipapi-crystal/ipapi-crystal/src`).chomp.stringify }} +
+ + +
+ + + + + + + + + + + +
+ +
+ + + + + + + + + +
+ + + diff --git a/Ipapi/AuthorizationFailedException.html b/Ipapi/AuthorizationFailedException.html new file mode 100644 index 0000000..56671a8 --- /dev/null +++ b/Ipapi/AuthorizationFailedException.html @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + Ipapi::AuthorizationFailedException - ipapi-crystal 0.3.0 + + + + + + + + + + +
+

+ + class Ipapi::AuthorizationFailedException + +

+ + + + + + + + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + ipapi.cr + +
+ + + + + + +

+ + + + Constructors +

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

+ + + + Constructor Detail +

+ +
+
+ + def self.new + + # +
+ +
+
+ +
+
+ + + + + + + + + +
+ + + diff --git a/Ipapi/Client.html b/Ipapi/Client.html new file mode 100644 index 0000000..d997bbc --- /dev/null +++ b/Ipapi/Client.html @@ -0,0 +1,827 @@ + + + + + + + + + + + + + + + + + Ipapi::Client - ipapi-crystal 0.3.0 + + + + + + + + + + +
+

+ + class Ipapi::Client + +

+ + + + + + + + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + ipapi.cr + +
+ + + + + +

+ + + + Constant Summary +

+ +
+ +
+ API_URL = "https://ipapi.co/" +
+ + +
+ + + +

+ + + + Constructors +

+ + + + + + + + +

+ + + + Instance Method Summary +

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

+ + + + Constructor Detail +

+ +
+
+ + def self.new(api_key : String | Nil = nil) + + # +
+ +
+
+ +
+
+ + + + + + + + +

+ + + + Instance Method Detail +

+ +
+
+ + def asn(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive autonomous system number of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def city(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive city name of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def continent_code(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive country code (2 letter, ISO 3166-1 alpha-2) of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def country(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive country code (2 letter, ISO 3166-1 alpha-2) of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def country_calling_code(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive country calling code (dial in code, comma separated) of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def country_name(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive short country name of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def currency(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive currency code (ISO 4217) of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def in_eu(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive whether IP address belongs to a country that is a member of the European Union (EU) of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def ip(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive public (external) IP address (same as URL #ip) of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def languages(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive languages spoken (comma separated 2 or 3 letter ISO 639 code with optional hyphen separated country suffix) of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def latitude(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive latitude of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def latlong(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive comma separated latitude and longitude of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def locate(ip_address : String | Nil = nil) : Location | Nil + + # +
+ +
+ +

Retrive the location of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def longitude(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive longitude of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def org(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive organization name of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def postal(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive postal code / zip code of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def region(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive region name (administrative division) of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def region_code(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive region code of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def timezone(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive timezone (IANA format i.e. “Area/Location”) of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ +
+
+ + def utc_offset(ip_address : String | Nil = nil) : String + + # +
+ +
+ +

Retrive UTC offset (with daylight saving time) as +HHMM or -HHMM (HH is hours, MM is minutes) of a specific IP address. +If ip_address is nil, use the client's IP.

+
+ +
+
+ +
+
+ + + +
+ + + diff --git a/Ipapi/Error.html b/Ipapi/Error.html new file mode 100644 index 0000000..6bd8c0f --- /dev/null +++ b/Ipapi/Error.html @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + Ipapi::Error - ipapi-crystal 0.3.0 + + + + + + + + + + +
+

+ + class Ipapi::Error + +

+ + + + + + + +

+ + + + Overview +

+ +

Generic error.

+ + + + + + + + + +

+ + + + Direct Known Subclasses +

+ + + + + + + +

+ + + + Defined in: +

+ + + ipapi.cr + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + diff --git a/Ipapi/ErrorResponse.html b/Ipapi/ErrorResponse.html new file mode 100644 index 0000000..262a06d --- /dev/null +++ b/Ipapi/ErrorResponse.html @@ -0,0 +1,352 @@ + + + + + + + + + + + + + + + + + Ipapi::ErrorResponse - ipapi-crystal 0.3.0 + + + + + + + + + + +
+

+ + class Ipapi::ErrorResponse + +

+ + + + + + + + + + + +

+ + + + Included Modules +

+ + + + + + + + + + + +

+ + + + Defined in: +

+ + + ipapi.cr + +
+ + + + + + +

+ + + + Constructors +

+ + + + + + + + +

+ + + + Instance Method Summary +

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

+ + + + Constructor Detail +

+ +
+
+ + def self.new(pull : JSON::PullParser) + + # +
+ +
+
+ +
+
+ + + + + + + + +

+ + + + Instance Method Detail +

+ +
+
+ + def error : Bool + + # +
+ +
+
+ +
+
+ +
+
+ + def ip : String + + # +
+ +
+
+ +
+
+ +
+
+ + def reason : String + + # +
+ +
+
+ +
+
+ + + +
+ + + diff --git a/Ipapi/Location.html b/Ipapi/Location.html new file mode 100644 index 0000000..97a44ef --- /dev/null +++ b/Ipapi/Location.html @@ -0,0 +1,808 @@ + + + + + + + + + + + + + + + + + Ipapi::Location - ipapi-crystal 0.3.0 + + + + + + + + + + +
+

+ + class Ipapi::Location + +

+ + + + + + + + + + + +

+ + + + Included Modules +

+ + + + + + + + + + + +

+ + + + Defined in: +

+ + + ipapi.cr + +
+ + + + + + +

+ + + + Constructors +

+ + + + + + + + +

+ + + + Instance Method Summary +

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

+ + + + Constructor Detail +

+ +
+
+ + def self.new(pull : JSON::PullParser) + + # +
+ +
+
+ +
+
+ + + + + + + + +

+ + + + Instance Method Detail +

+ +
+
+ + def asn : String + + # +
+ +
+
+ +
+
+ +
+
+ + def city : String + + # +
+ +
+
+ +
+
+ +
+
+ + def continent_code : String + + # +
+ +
+
+ +
+
+ +
+
+ + def country : String + + # +
+ +
+
+ +
+
+ +
+
+ + def country_area : Float64 + + # +
+ +
+
+ +
+
+ +
+
+ + def country_calling_code : String + + # +
+ +
+
+ +
+
+ +
+
+ + def country_capital : String + + # +
+ +
+
+ +
+
+ +
+
+ + def country_code : String + + # +
+ +
+
+ +
+
+ +
+
+ + def country_code_iso3 : String + + # +
+ +
+
+ +
+
+ +
+
+ + def country_name : String + + # +
+ +
+
+ +
+
+ +
+
+ + def country_population : Int32 + + # +
+ +
+
+ +
+
+ +
+
+ + def country_tld : String + + # +
+ +
+
+ +
+
+ +
+
+ + def currency : String + + # +
+ +
+
+ +
+
+ +
+
+ + def currency_name : String + + # +
+ +
+
+ +
+
+ +
+
+ + def in_eu : Bool + + # +
+ +
+
+ +
+
+ +
+
+ + def ip : String + + # +
+ +
+
+ +
+
+ +
+
+ + def languages : String + + # +
+ +
+
+ +
+
+ +
+
+ + def latitude : Float64 + + # +
+ +
+
+ +
+
+ +
+
+ + def longitude : Float64 + + # +
+ +
+
+ +
+
+ +
+
+ + def network : String + + # +
+ +
+
+ +
+
+ +
+
+ + def org : String + + # +
+ +
+
+ +
+
+ +
+
+ + def postal : String + + # +
+ +
+
+ +
+
+ +
+
+ + def region : String + + # +
+ +
+
+ +
+
+ +
+
+ + def region_code : String + + # +
+ +
+
+ +
+
+ +
+
+ + def timezone : String + + # +
+ +
+
+ +
+
+ +
+
+ + def utc_offset : String + + # +
+ +
+
+ +
+
+ +
+
+ + def version : String + + # +
+ +
+
+ +
+
+ + + +
+ + + diff --git a/Ipapi/PageNotFoundException.html b/Ipapi/PageNotFoundException.html new file mode 100644 index 0000000..8f98f54 --- /dev/null +++ b/Ipapi/PageNotFoundException.html @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + Ipapi::PageNotFoundException - ipapi-crystal 0.3.0 + + + + + + + + + + +
+

+ + class Ipapi::PageNotFoundException + +

+ + + + + + + + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + ipapi.cr + +
+ + + + + + +

+ + + + Constructors +

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

+ + + + Constructor Detail +

+ +
+
+ + def self.new + + # +
+ +
+
+ +
+
+ + + + + + + + + +
+ + + diff --git a/Ipapi/RateLimitedException.html b/Ipapi/RateLimitedException.html new file mode 100644 index 0000000..bf0fb63 --- /dev/null +++ b/Ipapi/RateLimitedException.html @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + Ipapi::RateLimitedException - ipapi-crystal 0.3.0 + + + + + + + + + + +
+

+ + class Ipapi::RateLimitedException + +

+ + + + + + + + + + + + + + + + + + + + +

+ + + + Defined in: +

+ + + ipapi.cr + +
+ + + + + + +

+ + + + Constructors +

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

+ + + + Constructor Detail +

+ +
+
+ + def self.new + + # +
+ +
+
+ +
+
+ + + + + + + + + +
+ + + diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..3d0a8a5 --- /dev/null +++ b/css/style.css @@ -0,0 +1,980 @@ +:root { + color-scheme: light dark; +} + +html, body { + background: #FFFFFF; + position: relative; + margin: 0; + padding: 0; + width: 100%; + height: 100%; + overflow: hidden; +} + +body { + font-family: "Avenir", "Tahoma", "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + color: #333; + line-height: 1.5; +} + +a { + color: #263F6C; +} + +a:visited { + color: #112750; +} + +h1, h2, h3, h4, h5, h6 { + margin: 35px 0 25px; + color: #444444; +} + +h1.type-name { + color: #47266E; + margin: 20px 0 30px; + background-color: #F8F8F8; + padding: 10px 12px; + border: 1px solid #EBEBEB; + border-radius: 2px; +} + +h2 { + border-bottom: 1px solid #E6E6E6; + padding-bottom: 5px; +} + +body { + display: flex; +} + +.sidebar, .main-content { + overflow: auto; +} + +.sidebar { + width: 30em; + color: #F8F4FD; + background-color: #2E1052; + padding: 0 0 30px; + box-shadow: inset -3px 0 4px rgba(0,0,0,.35); + line-height: 1.2; + z-index: 0; +} + +.sidebar .search-box { + padding: 13px 9px; +} + +.sidebar input { + display: block; + box-sizing: border-box; + margin: 0; + padding: 5px; + font: inherit; + font-family: inherit; + line-height: 1.2; + width: 100%; + border: 0; + outline: 0; + border-radius: 2px; + box-shadow: 0px 3px 5px rgba(0,0,0,.25); + transition: box-shadow .12s; +} + +.sidebar input:focus { + box-shadow: 0px 5px 6px rgba(0,0,0,.5); +} + +.sidebar input::-webkit-input-placeholder { /* Chrome/Opera/Safari */ + color: #757575; + font-size: 14px; + text-indent: 2px; +} + +.sidebar input::-moz-placeholder { /* Firefox 19+ */ + color: #757575; + font-size: 14px; + text-indent: 2px; +} + +.sidebar input:-ms-input-placeholder { /* IE 10+ */ + color: #757575; + font-size: 14px; + text-indent: 2px; +} + +.sidebar input:-moz-placeholder { /* Firefox 18- */ + color: #757575; + font-size: 14px; + text-indent: 2px; +} + +.project-summary { + padding: 9px 15px 30px 30px; +} + +.project-name { + font-size: 1.4rem; + margin: 0; + color: #f4f4f4; + font-weight: 600; +} + +.project-version { + margin-top: 5px; + display: inline-block; + position: relative; +} + +.project-version > form::after { + position: absolute; + right: 0; + top: 0; + content: "\25BC"; + font-size: .6em; + line-height: 1.2rem; + z-index: -1; +} + +.project-versions-nav { + cursor: pointer; + margin: 0; + padding: 0 .9em 0 0; + border: none; + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + background-color: transparent; + color: inherit; + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +.project-versions-nav:focus { + outline: none; +} + +.project-versions-nav > option { + color: initial; +} + +.sidebar ul { + margin: 0; + padding: 0; + list-style: none outside; +} + +.sidebar li { + display: block; + position: relative; +} + +.types-list li.hide { + display: none; +} + +.sidebar a { + text-decoration: none; + color: inherit; + transition: color .14s; +} +.types-list a { + display: block; + padding: 5px 15px 5px 30px; +} + +.types-list { + display: block; +} + +.sidebar a:focus { + outline: 1px solid #D1B7F1; +} + +.types-list a { + padding: 5px 15px 5px 30px; +} + +.sidebar .current > a, +.sidebar a:hover { + color: #866BA6; +} + +.types-list li ul { + overflow: hidden; + height: 0; + max-height: 0; + transition: 1s ease-in-out; +} + +.types-list li.parent { + padding-left: 30px; +} + +.types-list li.parent::before { + box-sizing: border-box; + content: "▼"; + display: block; + width: 30px; + height: 30px; + position: absolute; + top: 0; + left: 0; + text-align: center; + color: white; + font-size: 8px; + line-height: 30px; + transform: rotateZ(-90deg); + cursor: pointer; + transition: .2s linear; +} + + +.types-list li.parent > a { + padding-left: 0; +} + +.types-list li.parent.open::before { + transform: rotateZ(0); +} + +.types-list li.open > ul { + height: auto; + max-height: 1000em; +} + +.main-content { + padding: 0 30px 30px 30px; + width: 100%; +} + +.kind { + font-size: 60%; + color: #866BA6; +} + +.superclass-hierarchy { + margin: -15px 0 30px 0; + padding: 0; + list-style: none outside; + font-size: 80%; +} + +.superclass-hierarchy .superclass { + display: inline-block; + margin: 0 7px 0 0; + padding: 0; +} + +.superclass-hierarchy .superclass + .superclass::before { + content: "<"; + margin-right: 7px; +} + +.other-types-list li { + display: inline-block; +} + +.other-types-list, +.list-summary { + margin: 0 0 30px 0; + padding: 0; + list-style: none outside; +} + +.entry-const { + font-family: Menlo, Monaco, Consolas, 'Courier New', Courier, monospace; +} + +.entry-const code { + white-space: pre-wrap; +} + +.entry-summary { + padding-bottom: 4px; +} + +.superclass-hierarchy .superclass a, +.other-type a, +.entry-summary .signature { + padding: 4px 8px; + margin-bottom: 4px; + display: inline-block; + background-color: #f8f8f8; + color: #47266E; + border: 1px solid #f0f0f0; + text-decoration: none; + border-radius: 3px; + font-family: Menlo, Monaco, Consolas, 'Courier New', Courier, monospace; + transition: background .15s, border-color .15s; +} + +.superclass-hierarchy .superclass a:hover, +.other-type a:hover, +.entry-summary .signature:hover { + background: #D5CAE3; + border-color: #624288; +} + +.entry-summary .summary { + padding-left: 32px; +} + +.entry-summary .summary p { + margin: 12px 0 16px; +} + +.entry-summary a { + text-decoration: none; +} + +.entry-detail { + padding: 30px 0; +} + +.entry-detail .signature { + position: relative; + padding: 5px 15px; + margin-bottom: 10px; + display: block; + border-radius: 5px; + background-color: #f8f8f8; + color: #47266E; + border: 1px solid #f0f0f0; + font-family: Menlo, Monaco, Consolas, 'Courier New', Courier, monospace; + transition: .2s ease-in-out; +} + +.entry-detail:target .signature { + background-color: #D5CAE3; + border: 1px solid #624288; +} + +.entry-detail .signature .method-permalink { + position: absolute; + top: 0; + left: -35px; + padding: 5px 15px; + text-decoration: none; + font-weight: bold; + color: #624288; + opacity: .4; + transition: opacity .2s; +} + +.entry-detail .signature .method-permalink:hover { + opacity: 1; +} + +.entry-detail:target .signature .method-permalink { + opacity: 1; +} + +.methods-inherited { + padding-right: 10%; + line-height: 1.5em; +} + +.methods-inherited h3 { + margin-bottom: 4px; +} + +.methods-inherited a { + display: inline-block; + text-decoration: none; + color: #47266E; +} + +.methods-inherited a:hover { + text-decoration: underline; + color: #6C518B; +} + +.methods-inherited .tooltip>span { + background: #D5CAE3; + padding: 4px 8px; + border-radius: 3px; + margin: -4px -8px; +} + +.methods-inherited .tooltip * { + color: #47266E; +} + +pre { + padding: 10px 20px; + margin-top: 4px; + border-radius: 3px; + line-height: 1.45; + overflow: auto; + color: #333; + background: #fdfdfd; + font-size: 14px; + border: 1px solid #eee; +} + +code { + font-family: Menlo, Monaco, Consolas, 'Courier New', Courier, monospace; +} + +:not(pre) > code { + background-color: rgba(40,35,30,0.05); + padding: 0.2em 0.4em; + font-size: 85%; + border-radius: 3px; +} + +span.flag { + padding: 2px 4px 1px; + border-radius: 3px; + margin-right: 3px; + font-size: 11px; + border: 1px solid transparent; +} + +span.flag.orange { + background-color: #EE8737; + color: #FCEBDD; + border-color: #EB7317; +} + +span.flag.yellow { + background-color: #E4B91C; + color: #FCF8E8; + border-color: #B69115; +} + +span.flag.green { + background-color: #469C14; + color: #E2F9D3; + border-color: #34700E; +} + +span.flag.red { + background-color: #BF1919; + color: #F9ECEC; + border-color: #822C2C; +} + +span.flag.purple { + background-color: #2E1052; + color: #ECE1F9; + border-color: #1F0B37; +} + +span.flag.lime { + background-color: #a3ff00; + color: #222222; + border-color: #00ff1e; +} + +.tooltip>span { + position: absolute; + opacity: 0; + display: none; + pointer-events: none; +} + +.tooltip:hover>span { + display: inline-block; + opacity: 1; +} + +.c { + color: #969896; +} + +.n { + color: #0086b3; +} + +.t { + color: #0086b3; +} + +.s { + color: #183691; +} + +.i { + color: #7f5030; +} + +.k { + color: #a71d5d; +} + +.o { + color: #a71d5d; +} + +.m { + color: #795da3; +} + +.hidden { + display: none; +} +.search-results { + font-size: 90%; + line-height: 1.3; +} + +.search-results mark { + color: inherit; + background: transparent; + font-weight: bold; +} +.search-result { + padding: 5px 8px 5px 5px; + cursor: pointer; + border-left: 5px solid transparent; + transform: translateX(-3px); + transition: all .2s, background-color 0s, border .02s; + min-height: 3.2em; +} +.search-result.current { + border-left-color: #ddd; + background-color: rgba(200,200,200,0.4); + transform: translateX(0); + transition: all .2s, background-color .5s, border 0s; +} +.search-result.current:hover, +.search-result.current:focus { + border-left-color: #866BA6; +} +.search-result:not(.current):nth-child(2n) { + background-color: rgba(255,255,255,.06); +} +.search-result__title { + font-size: 105%; + word-break: break-all; + line-height: 1.1; + padding: 3px 0; +} +.search-result__title strong { + font-weight: normal; +} +.search-results .search-result__title > a { + padding: 0; + display: block; +} +.search-result__title > a > .args { + color: #dddddd; + font-weight: 300; + transition: inherit; + font-size: 88%; + line-height: 1.2; + letter-spacing: -.02em; +} +.search-result__title > a > .args * { + color: inherit; +} + +.search-result a, +.search-result a:hover { + color: inherit; +} +.search-result:not(.current):hover .search-result__title > a, +.search-result:not(.current):focus .search-result__title > a, +.search-result__title > a:focus { + color: #866BA6; +} +.search-result:not(.current):hover .args, +.search-result:not(.current):focus .args { + color: #6a5a7d; +} + +.search-result__type { + color: #e8e8e8; + font-weight: 300; +} +.search-result__doc { + color: #bbbbbb; + font-size: 90%; +} +.search-result__doc p { + margin: 0; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + line-height: 1.2em; + max-height: 2.4em; +} + +.js-modal-visible .modal-background { + display: flex; +} +.main-content { + position: relative; +} +.modal-background { + position: absolute; + display: none; + height: 100%; + width: 100%; + background: rgba(120,120,120,.4); + z-index: 100; + align-items: center; + justify-content: center; +} +.usage-modal { + max-width: 90%; + background: #fff; + border: 2px solid #ccc; + border-radius: 9px; + padding: 5px 15px 20px; + min-width: 50%; + color: #555; + position: relative; + transform: scale(.5); + transition: transform 200ms; +} +.js-modal-visible .usage-modal { + transform: scale(1); +} +.usage-modal > .close-button { + position: absolute; + right: 15px; + top: 8px; + color: #aaa; + font-size: 27px; + cursor: pointer; +} +.usage-modal > .close-button:hover { + text-shadow: 2px 2px 2px #ccc; + color: #999; +} +.modal-title { + margin: 0; + text-align: center; + font-weight: normal; + color: #666; + border-bottom: 2px solid #ddd; + padding: 10px; +} +.usage-list { + padding: 0; + margin: 13px; +} +.usage-list > li { + padding: 5px 2px; + overflow: auto; + padding-left: 100px; + min-width: 12em; +} +.usage-modal kbd { + background: #eee; + border: 1px solid #ccc; + border-bottom-width: 2px; + border-radius: 3px; + padding: 3px 8px; + font-family: monospace; + margin-right: 2px; + display: inline-block; +} +.usage-key { + float: left; + clear: left; + margin-left: -100px; + margin-right: 12px; +} +.doc-inherited { + font-weight: bold; +} + +.anchor { + float: left; + padding-right: 4px; + margin-left: -20px; +} + +.main-content .anchor .octicon-link { + width: 16px; + height: 16px; +} + +.main-content .anchor:focus { + outline: none +} + +.main-content h1:hover .anchor, +.main-content h2:hover .anchor, +.main-content h3:hover .anchor, +.main-content h4:hover .anchor, +.main-content h5:hover .anchor, +.main-content h6:hover .anchor { + text-decoration: none +} + +.main-content h1 .octicon-link, +.main-content h2 .octicon-link, +.main-content h3 .octicon-link, +.main-content h4 .octicon-link, +.main-content h5 .octicon-link, +.main-content h6 .octicon-link { + visibility: hidden +} + +.main-content h1:hover .anchor .octicon-link, +.main-content h2:hover .anchor .octicon-link, +.main-content h3:hover .anchor .octicon-link, +.main-content h4:hover .anchor .octicon-link, +.main-content h5:hover .anchor .octicon-link, +.main-content h6:hover .anchor .octicon-link { + visibility: visible +} + +img { + max-width: 100%; +} + +table { + font-size: 14px; + display: block; + max-width: -moz-fit-content; + max-width: fit-content; + overflow-x: auto; + white-space: nowrap; + background: #fdfdfd; + text-align: center; + border: 1px solid #eee; + border-collapse: collapse; + padding: 0px 5px 0px 5px; +} + +table th { + padding: 10px; + letter-spacing: 1px; + border-bottom: 1px solid #eee; +} + +table td { + padding: 10px; +} + +#sidebar-btn { + height: 32px; + width: 32px; +} + +#sidebar-btn-label { + height: 2em; + width: 2em; +} + +#sidebar-btn, #sidebar-btn-label { + display: none; + margin: .7rem; + appearance: none; + color: black; + cursor: pointer; +} + +@media only screen and (max-width: 635px) { + .sidebar, .main-content { + /* svg size + vertical margin - .search-box padding-top */ + padding-top: calc(2em + 2 * 0.7rem - 13px); + } + + #sidebar-btn, #sidebar-btn-label { + display: block; + position: absolute; + z-index: 50; + transition-duration: 200ms; + left: 0; + } + + #sidebar-btn:not(:checked) ~ #sidebar-btn-label > .close, + #sidebar-btn:checked ~ #sidebar-btn-label > .open, + #sidebar-btn:checked ~ .main-content { + display: none; + } + + #sidebar-btn:checked { + left: calc(100% - 32px - (2 * 0.7rem)); + } + + #sidebar-btn:checked ~ #sidebar-btn-label { + color: white; + /* 100% - svg size - horizontal margin */ + left: calc(100% - 2em - (2 * 0.7rem)); + } + + #sidebar-btn~.sidebar { + width: 0%; + } + + #sidebar-btn:checked~.sidebar { + visibility: visible; + width: 100%; + } + + .sidebar { + transition-duration: 200ms; + max-width: 100vw; + visibility: hidden; + } +} + +@media (prefers-color-scheme: dark) { + html, body { + background: #1b1b1b; + } + + body { + color: white; + } + + a { + color: #8cb4ff; + } + + .main-content a:visited { + color: #5f8de3; + } + + h1, h2, h3, h4, h5, h6 { + color: white; + } + + h1.type-name { + color: white; + background-color: #202020; + border: 1px solid #353535; + } + + .project-versions-nav > option { + background-color: #222; + } + + .superclass-hierarchy .superclass a, + .superclass-hierarchy .superclass a:visited, + .other-type a, + .other-type a:visited, + .entry-summary .signature, + .entry-summary a:visited { + background-color: #202020; + color: white; + border: 1px solid #353535; + } + + .superclass-hierarchy .superclass a:hover, + .other-type a:hover, + .entry-summary .signature:hover { + background: #443d4d; + border-color: #b092d4; + } + + .kind { + color: #b092d4; + } + + .n { + color: #00ade6; + } + + .t { + color: #00ade6; + } + + .k { + color: #ff66ae; + } + + .o { + color: #ff66ae; + } + + .s { + color: #7799ff; + } + + .i { + color: #b38668; + } + + .m { + color: #b9a5d6; + } + + .c { + color: #a1a1a1; + } + + .methods-inherited a, .methods-inherited a:visited { + color: #B290D9; + } + + .methods-inherited a:hover { + color: #D4B7F4; + } + + .methods-inherited .tooltip>span { + background: #443d4d; + } + + .methods-inherited .tooltip * { + color: white; + } + + .entry-detail:target .signature { + background-color: #443d4d; + border: 1px solid #b092d4; + } + + .entry-detail .signature { + background-color: #202020; + color: white; + border: 1px solid #353535; + } + + .entry-detail .signature .method-permalink { + color: #b092d4; + } + + :not(pre)>code { + background-color: #202020; + } + + span.flag.purple { + background-color: #443d4d; + color: #ECE1F9; + border-color: #b092d4; + } + + .sidebar input::-webkit-input-placeholder { /* Chrome/Opera/Safari */ + color: white; + } + + .sidebar input::-moz-placeholder { /* Firefox 19+ */ + color: white; + } + + .sidebar input:-ms-input-placeholder { /* IE 10+ */ + color: white; + } + + .sidebar input:-moz-placeholder { /* Firefox 18- */ + color: white; + } + + pre, + table { + color: white; + background: #202020; + border: 1px solid #353535; + } + + table th { + border-bottom: 1px solid #353535; + } + + #sidebar-btn, #sidebar-btn-label { + color: white; + } +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..cdac2d3 --- /dev/null +++ b/index.html @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + ipapi-crystal 0.3.0 + + + + + + + + + + +
+

+ipapi-crystal

+

Crystal CI +GitHub release +Docs +License

+

Crystal bindings for https://ipapi.co (IP Address Location & Geolocation API)

+

+ +Installation

+
    +
  1. +

    Add the dependency to your shard.yml:

    +
    dependencies:
    +  ipapi:
    +    github: geocrystal/ipapi-crystal
    +
  2. +
  3. +

    Run shards install

    +
  4. +
+

+ +Usage

+
require "ipapi"
+
+client = Ipapi::Client.new
+
+location = client.locate("50.1.2.3")
+# => #<Ipapi::Location:0x7b45cdce5b40 @ip="50.1.2.3", @network="50.1.0.0/21", @version="IPv4", @city="Antelope", @region="California", @region_code="CA", @country="US", @country_name="United States", @country_code="US", @country_code_iso3="USA", @country_capital="Washington", @country_tld=".us", @continent_code="NA", @in_eu=false, @postal="95843", @latitude=38.7169, @longitude=-121.3677, @timezone="America/Los_Angeles", @utc_offset="-0700", @country_calling_code="+1", @currency="USD", @currency_name="Dollar", @languages="en-US,es-US,haw,fr", @country_area=9629091.0, @country_population=327167434, @asn="AS7065", @org="SNIC">
+
+location.ip                   # "50.1.2.3"
+location.network              # "50.1.0.0/21"
+location.version              # "IPv4"
+location.city                 # "Antelope"
+location.region               # "California"
+location.region_code          # "CA"
+location.country              # "US"
+location.country_name         # "United States"
+location.country_code         # "US"
+location.country_code_iso3    # "USA"
+location.country_capital      # "Washington"
+location.country_tld          # ".us"
+location.continent_code       # "NA"
+location.in_eu                # false
+location.postal               # "95843"
+location.latitude             # 38.7169
+location.longitude            # -121.3677
+location.timezone             # "America/Los_Angeles"
+location.utc_offset           # "-0700"
+location.country_calling_code # "+1"
+location.currency             # "USD"
+location.currency_name        # "Dollar"
+location.languages            # "en-US,es-US,haw,fr"
+location.country_area         # 9629091.0
+location.country_population   # 327167434
+location.asn                  # "AS7065"
+location.org                  # "SNIC"
+

+ +Contributing

+
    +
  1. Fork it (https://github.com/geocrystal/ipapi-crystal/fork)
  2. +
  3. Create your feature branch (git checkout -b my-new-feature)
  4. +
  5. Commit your changes (git commit -am 'Add some feature')
  6. +
  7. Push to the branch (git push origin my-new-feature)
  8. +
  9. Create a new Pull Request
  10. +
+

+ +Contributors

+ +
+ + diff --git a/index.json b/index.json new file mode 100644 index 0000000..6331790 --- /dev/null +++ b/index.json @@ -0,0 +1 @@ +{"repository_name":"ipapi-crystal","body":"# ipapi-crystal\n\n[![Crystal CI](https://github.com/geocrystal/ipapi-crystal/actions/workflows/crystal.yml/badge.svg)](https://github.com/geocrystal/ipapi-crystal/actions/workflows/crystal.yml)\n[![GitHub release](https://img.shields.io/github/release/geocrystal/ipapi-crystal.svg)](https://github.com/geocrystal/ipapi-crystal/releases)\n[![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://geocrystal.github.io/ipapi-crystal/)\n[![License](https://img.shields.io/github/license/geocrystal/ipapi-crystal.svg)](https://github.com/geocrystal/ipapi-crystal/blob/main/LICENSE)\n\nCrystal bindings for (IP Address Location & Geolocation API)\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n ```yaml\n dependencies:\n ipapi:\n github: geocrystal/ipapi-crystal\n ```\n\n2. Run `shards install`\n\n## Usage\n\n```crystal\nrequire \"ipapi\"\n\nclient = Ipapi::Client.new\n\nlocation = client.locate(\"50.1.2.3\")\n# => #\n\nlocation.ip # \"50.1.2.3\"\nlocation.network # \"50.1.0.0/21\"\nlocation.version # \"IPv4\"\nlocation.city # \"Antelope\"\nlocation.region # \"California\"\nlocation.region_code # \"CA\"\nlocation.country # \"US\"\nlocation.country_name # \"United States\"\nlocation.country_code # \"US\"\nlocation.country_code_iso3 # \"USA\"\nlocation.country_capital # \"Washington\"\nlocation.country_tld # \".us\"\nlocation.continent_code # \"NA\"\nlocation.in_eu # false\nlocation.postal # \"95843\"\nlocation.latitude # 38.7169\nlocation.longitude # -121.3677\nlocation.timezone # \"America/Los_Angeles\"\nlocation.utc_offset # \"-0700\"\nlocation.country_calling_code # \"+1\"\nlocation.currency # \"USD\"\nlocation.currency_name # \"Dollar\"\nlocation.languages # \"en-US,es-US,haw,fr\"\nlocation.country_area # 9629091.0\nlocation.country_population # 327167434\nlocation.asn # \"AS7065\"\nlocation.org # \"SNIC\"\n```\n\n## Contributing\n\n1. Fork it ()\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Anton Maminov](https://github.com/mamantoha) - creator and maintainer\n","program":{"html_id":"ipapi-crystal/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"ipapi-crystal","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"ipapi-crystal/Ipapi","path":"Ipapi.html","kind":"module","full_name":"Ipapi","name":"Ipapi","abstract":false,"locations":[{"filename":"src/ipapi.cr","line_number":7,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"FIELDS","name":"FIELDS","value":"{\"ip\" => \"public (external) IP address (same as URL `ip`)\", \"city\" => \"city name\", \"region\" => \"region name (administrative division)\", \"region_code\" => \"region code\", \"country\" => \"country code (2 letter, ISO 3166-1 alpha-2)\", \"country_name\" => \"short country name\", \"continent_code\" => \"country code (2 letter, ISO 3166-1 alpha-2)\", \"in_eu\" => \"whether IP address belongs to a country that is a member of the European Union (EU)\", \"postal\" => \"postal code / zip code\", \"latitude\" => \"latitude\", \"longitude\" => \"longitude\", \"latlong\" => \"comma separated latitude and longitude\", \"timezone\" => \"timezone (IANA format i.e. “Area/Location”)\", \"utc_offset\" => \"UTC offset (with daylight saving time) as `+HHMM` or `-HHMM` (`HH` is hours, `MM` is minutes)\", \"languages\" => \"languages spoken (comma separated 2 or 3 letter ISO 639 code with optional hyphen separated country suffix)\", \"country_calling_code\" => \"country calling code (dial in code, comma separated)\", \"currency\" => \"currency code (ISO 4217)\", \"asn\" => \"autonomous system number\", \"org\" => \"organization name\"}"},{"id":"VERSION","name":"VERSION","value":"{{ (`shards version /__w/ipapi-crystal/ipapi-crystal/src`).chomp.stringify }}"}],"doc":"Crystal bindings for https://ipapi.co (IP Address Location & Geolocation API)\n\nAPI Docs : https://ipapi.co/api/","summary":"

Crystal bindings for https://ipapi.co (IP Address Location & Geolocation API)

","types":[{"html_id":"ipapi-crystal/Ipapi/AuthorizationFailedException","path":"Ipapi/AuthorizationFailedException.html","kind":"class","full_name":"Ipapi::AuthorizationFailedException","name":"AuthorizationFailedException","abstract":false,"superclass":{"html_id":"ipapi-crystal/Ipapi/Error","kind":"class","full_name":"Ipapi::Error","name":"Error"},"ancestors":[{"html_id":"ipapi-crystal/Ipapi/Error","kind":"class","full_name":"Ipapi::Error","name":"Error"},{"html_id":"ipapi-crystal/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"ipapi-crystal/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/ipapi.cr","line_number":104,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"ipapi-crystal/Ipapi","kind":"module","full_name":"Ipapi","name":"Ipapi"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":105,"url":null},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"ipapi-crystal/Ipapi/Client","path":"Ipapi/Client.html","kind":"class","full_name":"Ipapi::Client","name":"Client","abstract":false,"superclass":{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"ipapi-crystal/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/ipapi.cr","line_number":32,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"API_URL","name":"API_URL","value":"\"https://ipapi.co/\""}],"namespace":{"html_id":"ipapi-crystal/Ipapi","kind":"module","full_name":"Ipapi","name":"Ipapi"},"constructors":[{"html_id":"new(api_key:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"api_key","default_value":"nil","external_name":"api_key","restriction":"String | ::Nil"}],"args_string":"(api_key : String | Nil = nil)","args_html":"(api_key : String | Nil = nil)","location":{"filename":"src/ipapi.cr","line_number":35,"url":null},"def":{"name":"new","args":[{"name":"api_key","default_value":"nil","external_name":"api_key","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(api_key)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"asn(ip_address:String|Nil=nil):String-instance-method","name":"asn","doc":"Retrive autonomous system number of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive autonomous system number of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"asn","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"asn\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"city(ip_address:String|Nil=nil):String-instance-method","name":"city","doc":"Retrive city name of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive city name of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"city","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"city\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"continent_code(ip_address:String|Nil=nil):String-instance-method","name":"continent_code","doc":"Retrive country code (2 letter, ISO 3166-1 alpha-2) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive country code (2 letter, ISO 3166-1 alpha-2) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"continent_code","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"continent_code\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"country(ip_address:String|Nil=nil):String-instance-method","name":"country","doc":"Retrive country code (2 letter, ISO 3166-1 alpha-2) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive country code (2 letter, ISO 3166-1 alpha-2) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"country","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"country\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"country_calling_code(ip_address:String|Nil=nil):String-instance-method","name":"country_calling_code","doc":"Retrive country calling code (dial in code, comma separated) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive country calling code (dial in code, comma separated) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"country_calling_code","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"country_calling_code\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"country_name(ip_address:String|Nil=nil):String-instance-method","name":"country_name","doc":"Retrive short country name of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive short country name of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"country_name","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"country_name\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"currency(ip_address:String|Nil=nil):String-instance-method","name":"currency","doc":"Retrive currency code (ISO 4217) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive currency code (ISO 4217) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"currency","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"currency\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"in_eu(ip_address:String|Nil=nil):String-instance-method","name":"in_eu","doc":"Retrive whether IP address belongs to a country that is a member of the European Union (EU) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive whether IP address belongs to a country that is a member of the European Union (EU) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"in_eu","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"in_eu\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"ip(ip_address:String|Nil=nil):String-instance-method","name":"ip","doc":"Retrive public (external) IP address (same as URL `ip`) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive public (external) IP address (same as URL #ip) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"ip","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"ip\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"languages(ip_address:String|Nil=nil):String-instance-method","name":"languages","doc":"Retrive languages spoken (comma separated 2 or 3 letter ISO 639 code with optional hyphen separated country suffix) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive languages spoken (comma separated 2 or 3 letter ISO 639 code with optional hyphen separated country suffix) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"languages","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"languages\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"latitude(ip_address:String|Nil=nil):String-instance-method","name":"latitude","doc":"Retrive latitude of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive latitude of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"latitude","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"latitude\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"latlong(ip_address:String|Nil=nil):String-instance-method","name":"latlong","doc":"Retrive comma separated latitude and longitude of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive comma separated latitude and longitude of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"latlong","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"latlong\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"locate(ip_address:String|Nil=nil):Location|Nil-instance-method","name":"locate","doc":"Retrive the location of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive the location of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : Location | Nil","args_html":"(ip_address : String | Nil = nil) : Location | Nil","location":{"filename":"src/ipapi.cr","line_number":40,"url":null},"def":{"name":"locate","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"Location | ::Nil","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"json\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_locate_response(response)\n"}},{"html_id":"longitude(ip_address:String|Nil=nil):String-instance-method","name":"longitude","doc":"Retrive longitude of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive longitude of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"longitude","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"longitude\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"org(ip_address:String|Nil=nil):String-instance-method","name":"org","doc":"Retrive organization name of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive organization name of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"org","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"org\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"postal(ip_address:String|Nil=nil):String-instance-method","name":"postal","doc":"Retrive postal code / zip code of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive postal code / zip code of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"postal","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"postal\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"region(ip_address:String|Nil=nil):String-instance-method","name":"region","doc":"Retrive region name (administrative division) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive region name (administrative division) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"region","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"region\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"region_code(ip_address:String|Nil=nil):String-instance-method","name":"region_code","doc":"Retrive region code of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive region code of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"region_code","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"region_code\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"timezone(ip_address:String|Nil=nil):String-instance-method","name":"timezone","doc":"Retrive timezone (IANA format i.e. “Area/Location”) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive timezone (IANA format i.e.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"timezone","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"timezone\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"utc_offset(ip_address:String|Nil=nil):String-instance-method","name":"utc_offset","doc":"Retrive UTC offset (with daylight saving time) as `+HHMM` or `-HHMM` (`HH` is hours, `MM` is minutes) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive UTC offset (with daylight saving time) as +HHMM or -HHMM (HH is hours, MM is minutes) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"utc_offset","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"utc_offset\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}}]},{"html_id":"ipapi-crystal/Ipapi/Error","path":"Ipapi/Error.html","kind":"class","full_name":"Ipapi::Error","name":"Error","abstract":false,"superclass":{"html_id":"ipapi-crystal/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"ipapi-crystal/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"ipapi-crystal/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/ipapi.cr","line_number":101,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"ipapi-crystal/Ipapi/AuthorizationFailedException","kind":"class","full_name":"Ipapi::AuthorizationFailedException","name":"AuthorizationFailedException"},{"html_id":"ipapi-crystal/Ipapi/PageNotFoundException","kind":"class","full_name":"Ipapi::PageNotFoundException","name":"PageNotFoundException"},{"html_id":"ipapi-crystal/Ipapi/RateLimitedException","kind":"class","full_name":"Ipapi::RateLimitedException","name":"RateLimitedException"}],"namespace":{"html_id":"ipapi-crystal/Ipapi","kind":"module","full_name":"Ipapi","name":"Ipapi"},"doc":"Generic error.","summary":"

Generic error.

"},{"html_id":"ipapi-crystal/Ipapi/ErrorResponse","path":"Ipapi/ErrorResponse.html","kind":"class","full_name":"Ipapi::ErrorResponse","name":"ErrorResponse","abstract":false,"superclass":{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"ipapi-crystal/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"ipapi-crystal/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/ipapi.cr","line_number":154,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"ipapi-crystal/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"ipapi-crystal/Ipapi","kind":"module","full_name":"Ipapi","name":"Ipapi"},"constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/ipapi.cr","line_number":155,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"error:Bool-instance-method","name":"error","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":158,"url":null},"def":{"name":"error","return_type":"Bool","visibility":"Public","body":"@error"}},{"html_id":"ip:String-instance-method","name":"ip","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":157,"url":null},"def":{"name":"ip","return_type":"String","visibility":"Public","body":"@ip"}},{"html_id":"reason:String-instance-method","name":"reason","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":159,"url":null},"def":{"name":"reason","return_type":"String","visibility":"Public","body":"@reason"}}]},{"html_id":"ipapi-crystal/Ipapi/Location","path":"Ipapi/Location.html","kind":"class","full_name":"Ipapi::Location","name":"Location","abstract":false,"superclass":{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"ipapi-crystal/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"ipapi-crystal/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/ipapi.cr","line_number":122,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"ipapi-crystal/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"ipapi-crystal/Ipapi","kind":"module","full_name":"Ipapi","name":"Ipapi"},"constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/ipapi.cr","line_number":123,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"asn:String-instance-method","name":"asn","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":150,"url":null},"def":{"name":"asn","return_type":"String","visibility":"Public","body":"@asn"}},{"html_id":"city:String-instance-method","name":"city","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":128,"url":null},"def":{"name":"city","return_type":"String","visibility":"Public","body":"@city"}},{"html_id":"continent_code:String-instance-method","name":"continent_code","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":137,"url":null},"def":{"name":"continent_code","return_type":"String","visibility":"Public","body":"@continent_code"}},{"html_id":"country:String-instance-method","name":"country","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":131,"url":null},"def":{"name":"country","return_type":"String","visibility":"Public","body":"@country"}},{"html_id":"country_area:Float64-instance-method","name":"country_area","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":148,"url":null},"def":{"name":"country_area","return_type":"Float64","visibility":"Public","body":"@country_area"}},{"html_id":"country_calling_code:String-instance-method","name":"country_calling_code","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":144,"url":null},"def":{"name":"country_calling_code","return_type":"String","visibility":"Public","body":"@country_calling_code"}},{"html_id":"country_capital:String-instance-method","name":"country_capital","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":135,"url":null},"def":{"name":"country_capital","return_type":"String","visibility":"Public","body":"@country_capital"}},{"html_id":"country_code:String-instance-method","name":"country_code","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":133,"url":null},"def":{"name":"country_code","return_type":"String","visibility":"Public","body":"@country_code"}},{"html_id":"country_code_iso3:String-instance-method","name":"country_code_iso3","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":134,"url":null},"def":{"name":"country_code_iso3","return_type":"String","visibility":"Public","body":"@country_code_iso3"}},{"html_id":"country_name:String-instance-method","name":"country_name","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":132,"url":null},"def":{"name":"country_name","return_type":"String","visibility":"Public","body":"@country_name"}},{"html_id":"country_population:Int32-instance-method","name":"country_population","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":149,"url":null},"def":{"name":"country_population","return_type":"Int32","visibility":"Public","body":"@country_population"}},{"html_id":"country_tld:String-instance-method","name":"country_tld","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":136,"url":null},"def":{"name":"country_tld","return_type":"String","visibility":"Public","body":"@country_tld"}},{"html_id":"currency:String-instance-method","name":"currency","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":145,"url":null},"def":{"name":"currency","return_type":"String","visibility":"Public","body":"@currency"}},{"html_id":"currency_name:String-instance-method","name":"currency_name","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":146,"url":null},"def":{"name":"currency_name","return_type":"String","visibility":"Public","body":"@currency_name"}},{"html_id":"in_eu:Bool-instance-method","name":"in_eu","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":138,"url":null},"def":{"name":"in_eu","return_type":"Bool","visibility":"Public","body":"@in_eu"}},{"html_id":"ip:String-instance-method","name":"ip","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":125,"url":null},"def":{"name":"ip","return_type":"String","visibility":"Public","body":"@ip"}},{"html_id":"languages:String-instance-method","name":"languages","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":147,"url":null},"def":{"name":"languages","return_type":"String","visibility":"Public","body":"@languages"}},{"html_id":"latitude:Float64-instance-method","name":"latitude","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":140,"url":null},"def":{"name":"latitude","return_type":"Float64","visibility":"Public","body":"@latitude"}},{"html_id":"longitude:Float64-instance-method","name":"longitude","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":141,"url":null},"def":{"name":"longitude","return_type":"Float64","visibility":"Public","body":"@longitude"}},{"html_id":"network:String-instance-method","name":"network","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":126,"url":null},"def":{"name":"network","return_type":"String","visibility":"Public","body":"@network"}},{"html_id":"org:String-instance-method","name":"org","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":151,"url":null},"def":{"name":"org","return_type":"String","visibility":"Public","body":"@org"}},{"html_id":"postal:String-instance-method","name":"postal","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":139,"url":null},"def":{"name":"postal","return_type":"String","visibility":"Public","body":"@postal"}},{"html_id":"region:String-instance-method","name":"region","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":129,"url":null},"def":{"name":"region","return_type":"String","visibility":"Public","body":"@region"}},{"html_id":"region_code:String-instance-method","name":"region_code","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":130,"url":null},"def":{"name":"region_code","return_type":"String","visibility":"Public","body":"@region_code"}},{"html_id":"timezone:String-instance-method","name":"timezone","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":142,"url":null},"def":{"name":"timezone","return_type":"String","visibility":"Public","body":"@timezone"}},{"html_id":"utc_offset:String-instance-method","name":"utc_offset","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":143,"url":null},"def":{"name":"utc_offset","return_type":"String","visibility":"Public","body":"@utc_offset"}},{"html_id":"version:String-instance-method","name":"version","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":127,"url":null},"def":{"name":"version","return_type":"String","visibility":"Public","body":"@version"}}]},{"html_id":"ipapi-crystal/Ipapi/PageNotFoundException","path":"Ipapi/PageNotFoundException.html","kind":"class","full_name":"Ipapi::PageNotFoundException","name":"PageNotFoundException","abstract":false,"superclass":{"html_id":"ipapi-crystal/Ipapi/Error","kind":"class","full_name":"Ipapi::Error","name":"Error"},"ancestors":[{"html_id":"ipapi-crystal/Ipapi/Error","kind":"class","full_name":"Ipapi::Error","name":"Error"},{"html_id":"ipapi-crystal/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"ipapi-crystal/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/ipapi.cr","line_number":110,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"ipapi-crystal/Ipapi","kind":"module","full_name":"Ipapi","name":"Ipapi"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":111,"url":null},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"ipapi-crystal/Ipapi/RateLimitedException","path":"Ipapi/RateLimitedException.html","kind":"class","full_name":"Ipapi::RateLimitedException","name":"RateLimitedException","abstract":false,"superclass":{"html_id":"ipapi-crystal/Ipapi/Error","kind":"class","full_name":"Ipapi::Error","name":"Error"},"ancestors":[{"html_id":"ipapi-crystal/Ipapi/Error","kind":"class","full_name":"Ipapi::Error","name":"Error"},{"html_id":"ipapi-crystal/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"ipapi-crystal/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/ipapi.cr","line_number":116,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"ipapi-crystal/Ipapi","kind":"module","full_name":"Ipapi","name":"Ipapi"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":117,"url":null},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]}]}]}} \ No newline at end of file diff --git a/js/doc.js b/js/doc.js new file mode 100644 index 0000000..45d38b9 --- /dev/null +++ b/js/doc.js @@ -0,0 +1,1099 @@ +window.CrystalDocs = (window.CrystalDocs || {}); + +CrystalDocs.base_path = (CrystalDocs.base_path || ""); + +CrystalDocs.searchIndex = (CrystalDocs.searchIndex || false); +CrystalDocs.MAX_RESULTS_DISPLAY = 140; + +CrystalDocs.runQuery = function(query) { + function searchType(type, query, results) { + var matches = []; + var matchedFields = []; + var name = type.full_name; + var i = name.lastIndexOf("::"); + if (i > 0) { + name = name.substring(i + 2); + } + var nameMatches = query.matches(name); + if (nameMatches){ + matches = matches.concat(nameMatches); + matchedFields.push("name"); + } + + var namespaceMatches = query.matchesNamespace(type.full_name); + if(namespaceMatches){ + matches = matches.concat(namespaceMatches); + matchedFields.push("name"); + } + + var docMatches = query.matches(type.doc); + if(docMatches){ + matches = matches.concat(docMatches); + matchedFields.push("doc"); + } + if (matches.length > 0) { + results.push({ + id: type.html_id, + result_type: "type", + kind: type.kind, + name: name, + full_name: type.full_name, + href: type.path, + summary: type.summary, + matched_fields: matchedFields, + matched_terms: matches + }); + } + + if (type.instance_methods) { + type.instance_methods.forEach(function(method) { + searchMethod(method, type, "instance_method", query, results); + }) + } + if (type.class_methods) { + type.class_methods.forEach(function(method) { + searchMethod(method, type, "class_method", query, results); + }) + } + if (type.constructors) { + type.constructors.forEach(function(constructor) { + searchMethod(constructor, type, "constructor", query, results); + }) + } + if (type.macros) { + type.macros.forEach(function(macro) { + searchMethod(macro, type, "macro", query, results); + }) + } + if (type.constants) { + type.constants.forEach(function(constant){ + searchConstant(constant, type, query, results); + }); + } + if (type.types) { + type.types.forEach(function(subtype){ + searchType(subtype, query, results); + }); + } + }; + + function searchMethod(method, type, kind, query, results) { + var matches = []; + var matchedFields = []; + var nameMatches = query.matchesMethod(method.name, kind, type); + if (nameMatches){ + matches = matches.concat(nameMatches); + matchedFields.push("name"); + } + + if (method.args) { + method.args.forEach(function(arg){ + var argMatches = query.matches(arg.external_name); + if (argMatches) { + matches = matches.concat(argMatches); + matchedFields.push("args"); + } + }); + } + + var docMatches = query.matches(type.doc); + if(docMatches){ + matches = matches.concat(docMatches); + matchedFields.push("doc"); + } + + if (matches.length > 0) { + var typeMatches = query.matches(type.full_name); + if (typeMatches) { + matchedFields.push("type"); + matches = matches.concat(typeMatches); + } + results.push({ + id: method.html_id, + type: type.full_name, + result_type: kind, + name: method.name, + full_name: type.full_name + "#" + method.name, + args_string: method.args_string, + summary: method.summary, + href: type.path + "#" + method.html_id, + matched_fields: matchedFields, + matched_terms: matches + }); + } + } + + function searchConstant(constant, type, query, results) { + var matches = []; + var matchedFields = []; + var nameMatches = query.matches(constant.name); + if (nameMatches){ + matches = matches.concat(nameMatches); + matchedFields.push("name"); + } + var docMatches = query.matches(constant.doc); + if(docMatches){ + matches = matches.concat(docMatches); + matchedFields.push("doc"); + } + if (matches.length > 0) { + var typeMatches = query.matches(type.full_name); + if (typeMatches) { + matchedFields.push("type"); + matches = matches.concat(typeMatches); + } + results.push({ + id: constant.id, + type: type.full_name, + result_type: "constant", + name: constant.name, + full_name: type.full_name + "#" + constant.name, + value: constant.value, + summary: constant.summary, + href: type.path + "#" + constant.id, + matched_fields: matchedFields, + matched_terms: matches + }); + } + } + + var results = []; + searchType(CrystalDocs.searchIndex.program, query, results); + return results; +}; + +CrystalDocs.rankResults = function(results, query) { + function uniqueArray(ar) { + var j = {}; + + ar.forEach(function(v) { + j[v + "::" + typeof v] = v; + }); + + return Object.keys(j).map(function(v) { + return j[v]; + }); + } + + results = results.sort(function(a, b) { + var matchedTermsDiff = uniqueArray(b.matched_terms).length - uniqueArray(a.matched_terms).length; + var aHasDocs = b.matched_fields.includes("doc"); + var bHasDocs = b.matched_fields.includes("doc"); + + var aOnlyDocs = aHasDocs && a.matched_fields.length == 1; + var bOnlyDocs = bHasDocs && b.matched_fields.length == 1; + + if (a.result_type == "type" && b.result_type != "type" && !aOnlyDocs) { + if(CrystalDocs.DEBUG) { console.log("a is type b not"); } + return -1; + } else if (b.result_type == "type" && a.result_type != "type" && !bOnlyDocs) { + if(CrystalDocs.DEBUG) { console.log("b is type, a not"); } + return 1; + } + if (a.matched_fields.includes("name")) { + if (b.matched_fields.includes("name")) { + var a_name = (CrystalDocs.prefixForType(a.result_type) || "") + ((a.result_type == "type") ? a.full_name : a.name); + var b_name = (CrystalDocs.prefixForType(b.result_type) || "") + ((b.result_type == "type") ? b.full_name : b.name); + a_name = a_name.toLowerCase(); + b_name = b_name.toLowerCase(); + for(var i = 0; i < query.normalizedTerms.length; i++) { + var term = query.terms[i].replace(/^::?|::?$/, ""); + var a_orig_index = a_name.indexOf(term); + var b_orig_index = b_name.indexOf(term); + if(CrystalDocs.DEBUG) { console.log("term: " + term + " a: " + a_name + " b: " + b_name); } + if(CrystalDocs.DEBUG) { console.log(a_orig_index, b_orig_index, a_orig_index - b_orig_index); } + if (a_orig_index >= 0) { + if (b_orig_index >= 0) { + if(CrystalDocs.DEBUG) { console.log("both have exact match", a_orig_index > b_orig_index ? -1 : 1); } + if(a_orig_index != b_orig_index) { + if(CrystalDocs.DEBUG) { console.log("both have exact match at different positions", a_orig_index > b_orig_index ? 1 : -1); } + return a_orig_index > b_orig_index ? 1 : -1; + } + } else { + if(CrystalDocs.DEBUG) { console.log("a has exact match, b not"); } + return -1; + } + } else if (b_orig_index >= 0) { + if(CrystalDocs.DEBUG) { console.log("b has exact match, a not"); } + return 1; + } + } + } else { + if(CrystalDocs.DEBUG) { console.log("a has match in name, b not"); } + return -1; + } + } else if ( + !a.matched_fields.includes("name") && + b.matched_fields.includes("name") + ) { + return 1; + } + + if (matchedTermsDiff != 0 || (aHasDocs != bHasDocs)) { + if(CrystalDocs.DEBUG) { console.log("matchedTermsDiff: " + matchedTermsDiff, aHasDocs, bHasDocs); } + return matchedTermsDiff; + } + + var matchedFieldsDiff = b.matched_fields.length - a.matched_fields.length; + if (matchedFieldsDiff != 0) { + if(CrystalDocs.DEBUG) { console.log("matched to different number of fields: " + matchedFieldsDiff); } + return matchedFieldsDiff > 0 ? 1 : -1; + } + + var nameCompare = a.name.localeCompare(b.name); + if(nameCompare != 0){ + if(CrystalDocs.DEBUG) { console.log("nameCompare resulted in: " + a.name + "<=>" + b.name + ": " + nameCompare); } + return nameCompare > 0 ? 1 : -1; + } + + if(a.matched_fields.includes("args") && b.matched_fields.includes("args")) { + for(var i = 0; i < query.terms.length; i++) { + var term = query.terms[i]; + var aIndex = a.args_string.indexOf(term); + var bIndex = b.args_string.indexOf(term); + if(CrystalDocs.DEBUG) { console.log("index of " + term + " in args_string: " + aIndex + " - " + bIndex); } + if(aIndex >= 0){ + if(bIndex >= 0){ + if(aIndex != bIndex){ + return aIndex > bIndex ? 1 : -1; + } + }else{ + return -1; + } + }else if(bIndex >= 0) { + return 1; + } + } + } + + return 0; + }); + + if (results.length > 1) { + // if we have more than two search terms, only include results with the most matches + var bestMatchedTerms = uniqueArray(results[0].matched_terms).length; + + results = results.filter(function(result) { + return uniqueArray(result.matched_terms).length + 1 >= bestMatchedTerms; + }); + } + return results; +}; + +CrystalDocs.prefixForType = function(type) { + switch (type) { + case "instance_method": + return "#"; + + case "class_method": + case "macro": + case "constructor": + return "."; + + default: + return false; + } +}; + +CrystalDocs.displaySearchResults = function(results, query) { + function sanitize(html){ + return html.replace(/<(?!\/?code)[^>]+>/g, ""); + } + + // limit results + if (results.length > CrystalDocs.MAX_RESULTS_DISPLAY) { + results = results.slice(0, CrystalDocs.MAX_RESULTS_DISPLAY); + } + + var $frag = document.createDocumentFragment(); + var $resultsElem = document.querySelector(".search-list"); + $resultsElem.innerHTML = ""; + + results.forEach(function(result, i) { + var url = CrystalDocs.base_path + result.href; + var type = false; + + var title = query.highlight(result.result_type == "type" ? result.full_name : result.name); + + var prefix = CrystalDocs.prefixForType(result.result_type); + if (prefix) { + title = "" + prefix + "" + title; + } + + title = "" + title + ""; + + if (result.args_string) { + title += + "" + query.highlight(result.args_string) + ""; + } + + $elem = document.createElement("li"); + $elem.className = "search-result search-result--" + result.result_type; + $elem.dataset.href = url; + $elem.setAttribute("title", result.full_name + " docs page"); + + var $title = document.createElement("div"); + $title.setAttribute("class", "search-result__title"); + var $titleLink = document.createElement("a"); + $titleLink.setAttribute("href", url); + + $titleLink.innerHTML = title; + $title.appendChild($titleLink); + $elem.appendChild($title); + $elem.addEventListener("click", function() { + $titleLink.click(); + }); + + if (result.result_type !== "type") { + var $type = document.createElement("div"); + $type.setAttribute("class", "search-result__type"); + $type.innerHTML = query.highlight(result.type); + $elem.appendChild($type); + } + + if(result.summary){ + var $doc = document.createElement("div"); + $doc.setAttribute("class", "search-result__doc"); + $doc.innerHTML = query.highlight(sanitize(result.summary)); + $elem.appendChild($doc); + } + + $elem.appendChild(document.createComment(JSON.stringify(result))); + $frag.appendChild($elem); + }); + + $resultsElem.appendChild($frag); + + CrystalDocs.toggleResultsList(true); +}; + +CrystalDocs.toggleResultsList = function(visible) { + if (visible) { + document.querySelector(".types-list").classList.add("hidden"); + document.querySelector(".search-results").classList.remove("hidden"); + } else { + document.querySelector(".types-list").classList.remove("hidden"); + document.querySelector(".search-results").classList.add("hidden"); + } +}; + +CrystalDocs.Query = function(string) { + this.original = string; + this.terms = string.split(/\s+/).filter(function(word) { + return CrystalDocs.Query.stripModifiers(word).length > 0; + }); + + var normalized = this.terms.map(CrystalDocs.Query.normalizeTerm); + this.normalizedTerms = normalized; + + function runMatcher(field, matcher) { + if (!field) { + return false; + } + var normalizedValue = CrystalDocs.Query.normalizeTerm(field); + + var matches = []; + normalized.forEach(function(term) { + if (matcher(normalizedValue, term)) { + matches.push(term); + } + }); + return matches.length > 0 ? matches : false; + } + + this.matches = function(field) { + return runMatcher(field, function(normalized, term) { + if (term[0] == "#" || term[0] == ".") { + return false; + } + return normalized.indexOf(term) >= 0; + }); + }; + + function namespaceMatcher(normalized, term){ + var i = term.indexOf(":"); + if(i >= 0){ + term = term.replace(/^::?|::?$/, ""); + var index = normalized.indexOf(term); + if((index == 0) || (index > 0 && normalized[index-1] == ":")){ + return true; + } + } + return false; + } + this.matchesMethod = function(name, kind, type) { + return runMatcher(name, function(normalized, term) { + var i = term.indexOf("#"); + if(i >= 0){ + if (kind != "instance_method") { + return false; + } + }else{ + i = term.indexOf("."); + if(i >= 0){ + if (kind != "class_method" && kind != "macro" && kind != "constructor") { + return false; + } + }else{ + //neither # nor . + if(term.indexOf(":") && namespaceMatcher(normalized, term)){ + return true; + } + } + } + + var methodName = term; + if(i >= 0){ + var termType = term.substring(0, i); + methodName = term.substring(i+1); + + if(termType != "") { + if(CrystalDocs.Query.normalizeTerm(type.full_name).indexOf(termType) < 0){ + return false; + } + } + } + return normalized.indexOf(methodName) >= 0; + }); + }; + + this.matchesNamespace = function(namespace){ + return runMatcher(namespace, namespaceMatcher); + }; + + this.highlight = function(string) { + if (typeof string == "undefined") { + return ""; + } + function escapeRegExp(s) { + return s.replace(/[.*+?\^${}()|\[\]\\]/g, "\\$&").replace(/^[#\.:]+/, ""); + } + return string.replace( + new RegExp("(" + this.normalizedTerms.map(escapeRegExp).join("|") + ")", "gi"), + "$1" + ); + }; +}; +CrystalDocs.Query.normalizeTerm = function(term) { + return term.toLowerCase(); +}; +CrystalDocs.Query.stripModifiers = function(term) { + switch (term[0]) { + case "#": + case ".": + case ":": + return term.substr(1); + + default: + return term; + } +} + +CrystalDocs.search = function(string) { + if(!CrystalDocs.searchIndex) { + console.log("CrystalDocs search index not initialized, delaying search"); + + document.addEventListener("CrystalDocs:loaded", function listener(){ + document.removeEventListener("CrystalDocs:loaded", listener); + CrystalDocs.search(string); + }); + return; + } + + document.dispatchEvent(new Event("CrystalDocs:searchStarted")); + + var query = new CrystalDocs.Query(string); + var results = CrystalDocs.runQuery(query); + results = CrystalDocs.rankResults(results, query); + CrystalDocs.displaySearchResults(results, query); + + document.dispatchEvent(new Event("CrystalDocs:searchPerformed")); +}; + +CrystalDocs.initializeIndex = function(data) { + CrystalDocs.searchIndex = data; + + document.dispatchEvent(new Event("CrystalDocs:loaded")); +}; + +CrystalDocs.loadIndex = function() { + function loadJSON(file, callback) { + var xobj = new XMLHttpRequest(); + xobj.overrideMimeType("application/json"); + xobj.open("GET", file, true); + xobj.onreadystatechange = function() { + if (xobj.readyState == 4 && xobj.status == "200") { + callback(xobj.responseText); + } + }; + xobj.send(null); + } + + function loadScript(file) { + script = document.createElement("script"); + script.src = file; + document.body.appendChild(script); + } + + function parseJSON(json) { + CrystalDocs.initializeIndex(JSON.parse(json)); + } + + for(var i = 0; i < document.scripts.length; i++){ + var script = document.scripts[i]; + if (script.src && script.src.indexOf("js/doc.js") >= 0) { + if (script.src.indexOf("file://") == 0) { + // We need to support JSONP files for the search to work on local file system. + var jsonPath = script.src.replace("js/doc.js", "search-index.js"); + loadScript(jsonPath); + return; + } else { + var jsonPath = script.src.replace("js/doc.js", "index.json"); + loadJSON(jsonPath, parseJSON); + return; + } + } + } + console.error("Could not find location of js/doc.js"); +}; + +// Callback for jsonp +function crystal_doc_search_index_callback(data) { + CrystalDocs.initializeIndex(data); +} + +Navigator = function(sidebar, searchInput, list, leaveSearchScope){ + this.list = list; + var self = this; + + var performingSearch = false; + + document.addEventListener('CrystalDocs:searchStarted', function(){ + performingSearch = true; + }); + document.addEventListener('CrystalDocs:searchDebounceStarted', function(){ + performingSearch = true; + }); + document.addEventListener('CrystalDocs:searchPerformed', function(){ + performingSearch = false; + }); + document.addEventListener('CrystalDocs:searchDebounceStopped', function(event){ + performingSearch = false; + }); + + function delayWhileSearching(callback) { + if(performingSearch){ + document.addEventListener('CrystalDocs:searchPerformed', function listener(){ + document.removeEventListener('CrystalDocs:searchPerformed', listener); + + // add some delay to let search results display kick in + setTimeout(callback, 100); + }); + }else{ + callback(); + } + } + + function clearMoveTimeout() { + clearTimeout(self.moveTimeout); + self.moveTimeout = null; + } + + function startMoveTimeout(upwards){ + /*if(self.moveTimeout) { + clearMoveTimeout(); + } + + var go = function() { + if (!self.moveTimeout) return; + self.move(upwards); + self.moveTimeout = setTimeout(go, 600); + }; + self.moveTimeout = setTimeout(go, 800);*/ + } + + function scrollCenter(element) { + var rect = element.getBoundingClientRect(); + var middle = sidebar.clientHeight / 2; + sidebar.scrollTop += rect.top + rect.height / 2 - middle; + } + + var move = this.move = function(upwards){ + if(!this.current){ + this.highlightFirst(); + return true; + } + var next = upwards ? this.current.previousElementSibling : this.current.nextElementSibling; + if(next && next.classList) { + this.highlight(next); + scrollCenter(next); + return true; + } + return false; + }; + + this.moveRight = function(){ + }; + this.moveLeft = function(){ + }; + + this.highlight = function(elem) { + if(!elem){ + return; + } + this.removeHighlight(); + + this.current = elem; + this.current.classList.add("current"); + }; + + this.highlightFirst = function(){ + this.highlight(this.list.querySelector('li:first-child')); + }; + + this.removeHighlight = function() { + if(this.current){ + this.current.classList.remove("current"); + } + this.current = null; + } + + this.openSelectedResult = function() { + if(this.current) { + this.current.click(); + } + } + + this.focus = function() { + searchInput.focus(); + searchInput.select(); + this.highlightFirst(); + } + + function handleKeyUp(event) { + switch(event.key) { + case "ArrowUp": + case "ArrowDown": + case "i": + case "j": + case "k": + case "l": + case "c": + case "h": + case "t": + case "n": + event.stopPropagation(); + clearMoveTimeout(); + } + } + + function handleKeyDown(event) { + switch(event.key) { + case "Enter": + event.stopPropagation(); + event.preventDefault(); + leaveSearchScope(); + self.openSelectedResult(); + break; + case "Escape": + event.stopPropagation(); + event.preventDefault(); + leaveSearchScope(); + break; + case "j": + case "c": + case "ArrowUp": + if(event.ctrlKey || event.key == "ArrowUp") { + event.stopPropagation(); + self.move(true); + startMoveTimeout(true); + } + break; + case "k": + case "h": + case "ArrowDown": + if(event.ctrlKey || event.key == "ArrowDown") { + event.stopPropagation(); + self.move(false); + startMoveTimeout(false); + } + break; + case "k": + case "t": + case "ArrowLeft": + if(event.ctrlKey || event.key == "ArrowLeft") { + event.stopPropagation(); + self.moveLeft(); + } + break; + case "l": + case "n": + case "ArrowRight": + if(event.ctrlKey || event.key == "ArrowRight") { + event.stopPropagation(); + self.moveRight(); + } + break; + } + } + + function handleInputKeyUp(event) { + switch(event.key) { + case "ArrowUp": + case "ArrowDown": + event.stopPropagation(); + event.preventDefault(); + clearMoveTimeout(); + } + } + + function handleInputKeyDown(event) { + switch(event.key) { + case "Enter": + event.stopPropagation(); + event.preventDefault(); + delayWhileSearching(function(){ + self.openSelectedResult(); + leaveSearchScope(); + }); + break; + case "Escape": + event.stopPropagation(); + event.preventDefault(); + // remove focus from search input + leaveSearchScope(); + sidebar.focus(); + break; + case "ArrowUp": + event.stopPropagation(); + event.preventDefault(); + self.move(true); + startMoveTimeout(true); + break; + + case "ArrowDown": + event.stopPropagation(); + event.preventDefault(); + self.move(false); + startMoveTimeout(false); + break; + } + } + + sidebar.tabIndex = 100; // set tabIndex to enable keylistener + sidebar.addEventListener('keyup', function(event) { + handleKeyUp(event); + }); + sidebar.addEventListener('keydown', function(event) { + handleKeyDown(event); + }); + searchInput.addEventListener('keydown', function(event) { + handleInputKeyDown(event); + }); + searchInput.addEventListener('keyup', function(event) { + handleInputKeyUp(event); + }); + this.move(); +}; + +CrystalDocs.initializeVersions = function () { + function loadJSON(file, callback) { + var xobj = new XMLHttpRequest(); + xobj.overrideMimeType("application/json"); + xobj.open("GET", file, true); + xobj.onreadystatechange = function() { + if (xobj.readyState == 4 && xobj.status == "200") { + callback(xobj.responseText); + } + }; + xobj.send(null); + } + + function parseJSON(json) { + CrystalDocs.loadConfig(JSON.parse(json)); + } + + $elem = document.querySelector("html > head > meta[name=\"crystal_docs.json_config_url\"]") + if ($elem == undefined) { + return + } + jsonURL = $elem.getAttribute("content") + if (jsonURL && jsonURL != "") { + loadJSON(jsonURL, parseJSON); + } +} + +CrystalDocs.loadConfig = function (config) { + var projectVersions = config["versions"] + var currentVersion = document.querySelector("html > head > meta[name=\"crystal_docs.project_version\"]").getAttribute("content") + + var currentVersionInList = projectVersions.find(function (element) { + return element.name == currentVersion + }) + + if (!currentVersionInList) { + projectVersions.unshift({ name: currentVersion, url: '#' }) + } + + $version = document.querySelector(".project-summary > .project-version") + $version.innerHTML = "" + + $select = document.createElement("select") + $select.classList.add("project-versions-nav") + $select.addEventListener("change", function () { + window.location.href = this.value + }) + projectVersions.forEach(function (version) { + $item = document.createElement("option") + $item.setAttribute("value", version.url) + $item.append(document.createTextNode(version.name)) + + if (version.name == currentVersion) { + $item.setAttribute("selected", true) + $item.setAttribute("disabled", true) + } + $select.append($item) + }); + $form = document.createElement("form") + $form.setAttribute("autocomplete", "off") + $form.append($select) + $version.append($form) +} + +document.addEventListener("DOMContentLoaded", function () { + CrystalDocs.initializeVersions() +}) + +var UsageModal = function(title, content) { + var $body = document.body; + var self = this; + var $modalBackground = document.createElement("div"); + $modalBackground.classList.add("modal-background"); + var $usageModal = document.createElement("div"); + $usageModal.classList.add("usage-modal"); + $modalBackground.appendChild($usageModal); + var $title = document.createElement("h3"); + $title.classList.add("modal-title"); + $title.innerHTML = title + $usageModal.appendChild($title); + var $closeButton = document.createElement("span"); + $closeButton.classList.add("close-button"); + $closeButton.setAttribute("title", "Close modal"); + $closeButton.innerText = '×'; + $usageModal.appendChild($closeButton); + $usageModal.insertAdjacentHTML("beforeend", content); + + $modalBackground.addEventListener('click', function(event) { + var element = event.target || event.srcElement; + + if(element == $modalBackground) { + self.hide(); + } + }); + $closeButton.addEventListener('click', function(event) { + self.hide(); + }); + + $body.insertAdjacentElement('beforeend', $modalBackground); + + this.show = function(){ + $body.classList.add("js-modal-visible"); + }; + this.hide = function(){ + $body.classList.remove("js-modal-visible"); + }; + this.isVisible = function(){ + return $body.classList.contains("js-modal-visible"); + } +} + + +document.addEventListener('DOMContentLoaded', function() { + var sessionStorage; + try { + sessionStorage = window.sessionStorage; + } catch (e) { } + if(!sessionStorage) { + sessionStorage = { + setItem: function() {}, + getItem: function() {}, + removeItem: function() {} + }; + } + + var repositoryName = document.querySelector('[name=repository-name]').getAttribute('content'); + var typesList = document.querySelector('.types-list'); + var searchInput = document.querySelector('.search-input'); + var parents = document.querySelectorAll('.types-list li.parent'); + + var scrollSidebarToOpenType = function(){ + var openTypes = typesList.querySelectorAll('.current'); + if (openTypes.length > 0) { + var lastOpenType = openTypes[openTypes.length - 1]; + lastOpenType.scrollIntoView(!(window.matchMedia('only screen and (max-width: 635px)')).matches); + } + } + + scrollSidebarToOpenType(); + + var setPersistentSearchQuery = function(value){ + sessionStorage.setItem(repositoryName + '::search-input:value', value); + } + + for(var i = 0; i < parents.length; i++) { + var _parent = parents[i]; + _parent.addEventListener('click', function(e) { + e.stopPropagation(); + + if(e.target.tagName.toLowerCase() == 'li') { + if(e.target.className.match(/open/)) { + sessionStorage.removeItem(e.target.getAttribute('data-id')); + e.target.className = e.target.className.replace(/ +open/g, ''); + } else { + sessionStorage.setItem(e.target.getAttribute('data-id'), '1'); + if(e.target.className.indexOf('open') == -1) { + e.target.className += ' open'; + } + } + } + }); + + if(sessionStorage.getItem(_parent.getAttribute('data-id')) == '1') { + _parent.className += ' open'; + } + } + + var leaveSearchScope = function(){ + CrystalDocs.toggleResultsList(false); + window.focus(); + } + + var navigator = new Navigator(document.querySelector('.types-list'), searchInput, document.querySelector(".search-results"), leaveSearchScope); + + CrystalDocs.loadIndex(); + var searchTimeout; + var lastSearchText = false; + var performSearch = function() { + document.dispatchEvent(new Event("CrystalDocs:searchDebounceStarted")); + + clearTimeout(searchTimeout); + searchTimeout = setTimeout(function() { + var text = searchInput.value; + + if(text == "") { + CrystalDocs.toggleResultsList(false); + }else if(text == lastSearchText){ + document.dispatchEvent(new Event("CrystalDocs:searchDebounceStopped")); + }else{ + CrystalDocs.search(text); + navigator.highlightFirst(); + searchInput.focus(); + } + lastSearchText = text; + setPersistentSearchQuery(text); + }, 200); + }; + + if(location.hash.length > 3 && location.hash.substring(0,3) == "#q="){ + // allows directly linking a search query which is then executed on the client + // this comes handy for establishing a custom browser search engine with https://crystal-lang.org/api/#q=%s as a search URL + // TODO: Add OpenSearch description + var searchQuery = location.hash.substring(3); + history.pushState({searchQuery: searchQuery}, "Search for " + searchQuery, location.href.replace(/#q=.*/, "")); + searchInput.value = searchQuery; + document.addEventListener('CrystalDocs:loaded', performSearch); + } + + if (searchInput.value.length == 0) { + var searchText = sessionStorage.getItem(repositoryName + '::search-input:value'); + if(searchText){ + searchInput.value = searchText; + } + } + searchInput.addEventListener('keyup', performSearch); + searchInput.addEventListener('input', performSearch); + + var usageModal = new UsageModal('Keyboard Shortcuts', '' + + '
    ' + + '
  • ' + + ' ' + + ' s,' + + ' /' + + ' ' + + ' Search' + + '
  • ' + + '
  • ' + + ' Esc' + + ' Abort search / Close modal' + + '
  • ' + + '
  • ' + + ' ' + + ' ,' + + ' Enter' + + ' ' + + ' Open highlighted result' + + '
  • ' + + '
  • ' + + ' ' + + ' ,' + + ' Ctrl+j' + + ' ' + + ' Select previous result' + + '
  • ' + + '
  • ' + + ' ' + + ' ,' + + ' Ctrl+k' + + ' ' + + ' Select next result' + + '
  • ' + + '
  • ' + + ' ?' + + ' Show usage info' + + '
  • ' + + '
' + ); + + function handleShortkeys(event) { + var element = event.target || event.srcElement; + + if(element.tagName == "INPUT" || element.tagName == "TEXTAREA" || element.parentElement.tagName == "TEXTAREA"){ + return; + } + + switch(event.key) { + case "?": + usageModal.show(); + break; + + case "Escape": + usageModal.hide(); + break; + + case "s": + case "/": + if(usageModal.isVisible()) { + return; + } + event.stopPropagation(); + navigator.focus(); + performSearch(); + break; + } + } + + document.addEventListener('keyup', handleShortkeys); + + var scrollToEntryFromLocationHash = function() { + var hash = window.location.hash; + if (hash) { + var targetAnchor = decodeURI(hash.substr(1)); + var targetEl = document.getElementById(targetAnchor) + if (targetEl) { + targetEl.offsetParent.scrollTop = targetEl.offsetTop; + } + } + }; + window.addEventListener("hashchange", scrollToEntryFromLocationHash, false); + scrollToEntryFromLocationHash(); +}); diff --git a/search-index.js b/search-index.js new file mode 100644 index 0000000..a656ffc --- /dev/null +++ b/search-index.js @@ -0,0 +1 @@ +crystal_doc_search_index_callback({"repository_name":"ipapi-crystal","body":"# ipapi-crystal\n\n[![Crystal CI](https://github.com/geocrystal/ipapi-crystal/actions/workflows/crystal.yml/badge.svg)](https://github.com/geocrystal/ipapi-crystal/actions/workflows/crystal.yml)\n[![GitHub release](https://img.shields.io/github/release/geocrystal/ipapi-crystal.svg)](https://github.com/geocrystal/ipapi-crystal/releases)\n[![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://geocrystal.github.io/ipapi-crystal/)\n[![License](https://img.shields.io/github/license/geocrystal/ipapi-crystal.svg)](https://github.com/geocrystal/ipapi-crystal/blob/main/LICENSE)\n\nCrystal bindings for (IP Address Location & Geolocation API)\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n ```yaml\n dependencies:\n ipapi:\n github: geocrystal/ipapi-crystal\n ```\n\n2. Run `shards install`\n\n## Usage\n\n```crystal\nrequire \"ipapi\"\n\nclient = Ipapi::Client.new\n\nlocation = client.locate(\"50.1.2.3\")\n# => #\n\nlocation.ip # \"50.1.2.3\"\nlocation.network # \"50.1.0.0/21\"\nlocation.version # \"IPv4\"\nlocation.city # \"Antelope\"\nlocation.region # \"California\"\nlocation.region_code # \"CA\"\nlocation.country # \"US\"\nlocation.country_name # \"United States\"\nlocation.country_code # \"US\"\nlocation.country_code_iso3 # \"USA\"\nlocation.country_capital # \"Washington\"\nlocation.country_tld # \".us\"\nlocation.continent_code # \"NA\"\nlocation.in_eu # false\nlocation.postal # \"95843\"\nlocation.latitude # 38.7169\nlocation.longitude # -121.3677\nlocation.timezone # \"America/Los_Angeles\"\nlocation.utc_offset # \"-0700\"\nlocation.country_calling_code # \"+1\"\nlocation.currency # \"USD\"\nlocation.currency_name # \"Dollar\"\nlocation.languages # \"en-US,es-US,haw,fr\"\nlocation.country_area # 9629091.0\nlocation.country_population # 327167434\nlocation.asn # \"AS7065\"\nlocation.org # \"SNIC\"\n```\n\n## Contributing\n\n1. Fork it ()\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Anton Maminov](https://github.com/mamantoha) - creator and maintainer\n","program":{"html_id":"ipapi-crystal/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"ipapi-crystal","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"ipapi-crystal/Ipapi","path":"Ipapi.html","kind":"module","full_name":"Ipapi","name":"Ipapi","abstract":false,"locations":[{"filename":"src/ipapi.cr","line_number":7,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"FIELDS","name":"FIELDS","value":"{\"ip\" => \"public (external) IP address (same as URL `ip`)\", \"city\" => \"city name\", \"region\" => \"region name (administrative division)\", \"region_code\" => \"region code\", \"country\" => \"country code (2 letter, ISO 3166-1 alpha-2)\", \"country_name\" => \"short country name\", \"continent_code\" => \"country code (2 letter, ISO 3166-1 alpha-2)\", \"in_eu\" => \"whether IP address belongs to a country that is a member of the European Union (EU)\", \"postal\" => \"postal code / zip code\", \"latitude\" => \"latitude\", \"longitude\" => \"longitude\", \"latlong\" => \"comma separated latitude and longitude\", \"timezone\" => \"timezone (IANA format i.e. “Area/Location”)\", \"utc_offset\" => \"UTC offset (with daylight saving time) as `+HHMM` or `-HHMM` (`HH` is hours, `MM` is minutes)\", \"languages\" => \"languages spoken (comma separated 2 or 3 letter ISO 639 code with optional hyphen separated country suffix)\", \"country_calling_code\" => \"country calling code (dial in code, comma separated)\", \"currency\" => \"currency code (ISO 4217)\", \"asn\" => \"autonomous system number\", \"org\" => \"organization name\"}"},{"id":"VERSION","name":"VERSION","value":"{{ (`shards version /__w/ipapi-crystal/ipapi-crystal/src`).chomp.stringify }}"}],"doc":"Crystal bindings for https://ipapi.co (IP Address Location & Geolocation API)\n\nAPI Docs : https://ipapi.co/api/","summary":"

Crystal bindings for https://ipapi.co (IP Address Location & Geolocation API)

","types":[{"html_id":"ipapi-crystal/Ipapi/AuthorizationFailedException","path":"Ipapi/AuthorizationFailedException.html","kind":"class","full_name":"Ipapi::AuthorizationFailedException","name":"AuthorizationFailedException","abstract":false,"superclass":{"html_id":"ipapi-crystal/Ipapi/Error","kind":"class","full_name":"Ipapi::Error","name":"Error"},"ancestors":[{"html_id":"ipapi-crystal/Ipapi/Error","kind":"class","full_name":"Ipapi::Error","name":"Error"},{"html_id":"ipapi-crystal/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"ipapi-crystal/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/ipapi.cr","line_number":104,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"ipapi-crystal/Ipapi","kind":"module","full_name":"Ipapi","name":"Ipapi"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":105,"url":null},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"ipapi-crystal/Ipapi/Client","path":"Ipapi/Client.html","kind":"class","full_name":"Ipapi::Client","name":"Client","abstract":false,"superclass":{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"ipapi-crystal/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/ipapi.cr","line_number":32,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"API_URL","name":"API_URL","value":"\"https://ipapi.co/\""}],"namespace":{"html_id":"ipapi-crystal/Ipapi","kind":"module","full_name":"Ipapi","name":"Ipapi"},"constructors":[{"html_id":"new(api_key:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"api_key","default_value":"nil","external_name":"api_key","restriction":"String | ::Nil"}],"args_string":"(api_key : String | Nil = nil)","args_html":"(api_key : String | Nil = nil)","location":{"filename":"src/ipapi.cr","line_number":35,"url":null},"def":{"name":"new","args":[{"name":"api_key","default_value":"nil","external_name":"api_key","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(api_key)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"asn(ip_address:String|Nil=nil):String-instance-method","name":"asn","doc":"Retrive autonomous system number of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive autonomous system number of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"asn","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"asn\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"city(ip_address:String|Nil=nil):String-instance-method","name":"city","doc":"Retrive city name of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive city name of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"city","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"city\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"continent_code(ip_address:String|Nil=nil):String-instance-method","name":"continent_code","doc":"Retrive country code (2 letter, ISO 3166-1 alpha-2) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive country code (2 letter, ISO 3166-1 alpha-2) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"continent_code","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"continent_code\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"country(ip_address:String|Nil=nil):String-instance-method","name":"country","doc":"Retrive country code (2 letter, ISO 3166-1 alpha-2) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive country code (2 letter, ISO 3166-1 alpha-2) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"country","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"country\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"country_calling_code(ip_address:String|Nil=nil):String-instance-method","name":"country_calling_code","doc":"Retrive country calling code (dial in code, comma separated) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive country calling code (dial in code, comma separated) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"country_calling_code","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"country_calling_code\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"country_name(ip_address:String|Nil=nil):String-instance-method","name":"country_name","doc":"Retrive short country name of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive short country name of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"country_name","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"country_name\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"currency(ip_address:String|Nil=nil):String-instance-method","name":"currency","doc":"Retrive currency code (ISO 4217) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive currency code (ISO 4217) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"currency","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"currency\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"in_eu(ip_address:String|Nil=nil):String-instance-method","name":"in_eu","doc":"Retrive whether IP address belongs to a country that is a member of the European Union (EU) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive whether IP address belongs to a country that is a member of the European Union (EU) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"in_eu","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"in_eu\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"ip(ip_address:String|Nil=nil):String-instance-method","name":"ip","doc":"Retrive public (external) IP address (same as URL `ip`) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive public (external) IP address (same as URL #ip) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"ip","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"ip\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"languages(ip_address:String|Nil=nil):String-instance-method","name":"languages","doc":"Retrive languages spoken (comma separated 2 or 3 letter ISO 639 code with optional hyphen separated country suffix) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive languages spoken (comma separated 2 or 3 letter ISO 639 code with optional hyphen separated country suffix) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"languages","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"languages\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"latitude(ip_address:String|Nil=nil):String-instance-method","name":"latitude","doc":"Retrive latitude of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive latitude of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"latitude","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"latitude\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"latlong(ip_address:String|Nil=nil):String-instance-method","name":"latlong","doc":"Retrive comma separated latitude and longitude of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive comma separated latitude and longitude of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"latlong","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"latlong\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"locate(ip_address:String|Nil=nil):Location|Nil-instance-method","name":"locate","doc":"Retrive the location of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive the location of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : Location | Nil","args_html":"(ip_address : String | Nil = nil) : Location | Nil","location":{"filename":"src/ipapi.cr","line_number":40,"url":null},"def":{"name":"locate","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"Location | ::Nil","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"json\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_locate_response(response)\n"}},{"html_id":"longitude(ip_address:String|Nil=nil):String-instance-method","name":"longitude","doc":"Retrive longitude of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive longitude of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"longitude","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"longitude\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"org(ip_address:String|Nil=nil):String-instance-method","name":"org","doc":"Retrive organization name of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive organization name of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"org","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"org\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"postal(ip_address:String|Nil=nil):String-instance-method","name":"postal","doc":"Retrive postal code / zip code of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive postal code / zip code of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"postal","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"postal\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"region(ip_address:String|Nil=nil):String-instance-method","name":"region","doc":"Retrive region name (administrative division) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive region name (administrative division) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"region","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"region\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"region_code(ip_address:String|Nil=nil):String-instance-method","name":"region_code","doc":"Retrive region code of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive region code of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"region_code","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"region_code\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"timezone(ip_address:String|Nil=nil):String-instance-method","name":"timezone","doc":"Retrive timezone (IANA format i.e. “Area/Location”) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive timezone (IANA format i.e.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"timezone","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"timezone\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}},{"html_id":"utc_offset(ip_address:String|Nil=nil):String-instance-method","name":"utc_offset","doc":"Retrive UTC offset (with daylight saving time) as `+HHMM` or `-HHMM` (`HH` is hours, `MM` is minutes) of a specific IP address.\nIf `ip_address` is `nil`, use the client's IP.","summary":"

Retrive UTC offset (with daylight saving time) as +HHMM or -HHMM (HH is hours, MM is minutes) of a specific IP address.

","abstract":false,"args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"args_string":"(ip_address : String | Nil = nil) : String","args_html":"(ip_address : String | Nil = nil) : String","location":{"filename":"src/ipapi.cr","line_number":49,"url":null},"def":{"name":"utc_offset","args":[{"name":"ip_address","default_value":"nil","external_name":"ip_address","restriction":"String | ::Nil"}],"return_type":"String","visibility":"Public","body":"url = (Path.posix([API_URL, ip_address, \"utc_offset\"].compact)).to_s\nif @api_key\n url = url + \"?key=#{@api_key}\"\nend\nresponse = HTTP::Client.get(url)\nparse_field_response(response)\n"}}]},{"html_id":"ipapi-crystal/Ipapi/Error","path":"Ipapi/Error.html","kind":"class","full_name":"Ipapi::Error","name":"Error","abstract":false,"superclass":{"html_id":"ipapi-crystal/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"ipapi-crystal/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"ipapi-crystal/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/ipapi.cr","line_number":101,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"subclasses":[{"html_id":"ipapi-crystal/Ipapi/AuthorizationFailedException","kind":"class","full_name":"Ipapi::AuthorizationFailedException","name":"AuthorizationFailedException"},{"html_id":"ipapi-crystal/Ipapi/PageNotFoundException","kind":"class","full_name":"Ipapi::PageNotFoundException","name":"PageNotFoundException"},{"html_id":"ipapi-crystal/Ipapi/RateLimitedException","kind":"class","full_name":"Ipapi::RateLimitedException","name":"RateLimitedException"}],"namespace":{"html_id":"ipapi-crystal/Ipapi","kind":"module","full_name":"Ipapi","name":"Ipapi"},"doc":"Generic error.","summary":"

Generic error.

"},{"html_id":"ipapi-crystal/Ipapi/ErrorResponse","path":"Ipapi/ErrorResponse.html","kind":"class","full_name":"Ipapi::ErrorResponse","name":"ErrorResponse","abstract":false,"superclass":{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"ipapi-crystal/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"ipapi-crystal/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/ipapi.cr","line_number":154,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"ipapi-crystal/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"ipapi-crystal/Ipapi","kind":"module","full_name":"Ipapi","name":"Ipapi"},"constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/ipapi.cr","line_number":155,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"error:Bool-instance-method","name":"error","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":158,"url":null},"def":{"name":"error","return_type":"Bool","visibility":"Public","body":"@error"}},{"html_id":"ip:String-instance-method","name":"ip","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":157,"url":null},"def":{"name":"ip","return_type":"String","visibility":"Public","body":"@ip"}},{"html_id":"reason:String-instance-method","name":"reason","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":159,"url":null},"def":{"name":"reason","return_type":"String","visibility":"Public","body":"@reason"}}]},{"html_id":"ipapi-crystal/Ipapi/Location","path":"Ipapi/Location.html","kind":"class","full_name":"Ipapi::Location","name":"Location","abstract":false,"superclass":{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"ipapi-crystal/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"ipapi-crystal/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/ipapi.cr","line_number":122,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"ipapi-crystal/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"ipapi-crystal/Ipapi","kind":"module","full_name":"Ipapi","name":"Ipapi"},"constructors":[{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/ipapi.cr","line_number":123,"url":null},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"asn:String-instance-method","name":"asn","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":150,"url":null},"def":{"name":"asn","return_type":"String","visibility":"Public","body":"@asn"}},{"html_id":"city:String-instance-method","name":"city","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":128,"url":null},"def":{"name":"city","return_type":"String","visibility":"Public","body":"@city"}},{"html_id":"continent_code:String-instance-method","name":"continent_code","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":137,"url":null},"def":{"name":"continent_code","return_type":"String","visibility":"Public","body":"@continent_code"}},{"html_id":"country:String-instance-method","name":"country","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":131,"url":null},"def":{"name":"country","return_type":"String","visibility":"Public","body":"@country"}},{"html_id":"country_area:Float64-instance-method","name":"country_area","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":148,"url":null},"def":{"name":"country_area","return_type":"Float64","visibility":"Public","body":"@country_area"}},{"html_id":"country_calling_code:String-instance-method","name":"country_calling_code","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":144,"url":null},"def":{"name":"country_calling_code","return_type":"String","visibility":"Public","body":"@country_calling_code"}},{"html_id":"country_capital:String-instance-method","name":"country_capital","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":135,"url":null},"def":{"name":"country_capital","return_type":"String","visibility":"Public","body":"@country_capital"}},{"html_id":"country_code:String-instance-method","name":"country_code","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":133,"url":null},"def":{"name":"country_code","return_type":"String","visibility":"Public","body":"@country_code"}},{"html_id":"country_code_iso3:String-instance-method","name":"country_code_iso3","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":134,"url":null},"def":{"name":"country_code_iso3","return_type":"String","visibility":"Public","body":"@country_code_iso3"}},{"html_id":"country_name:String-instance-method","name":"country_name","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":132,"url":null},"def":{"name":"country_name","return_type":"String","visibility":"Public","body":"@country_name"}},{"html_id":"country_population:Int32-instance-method","name":"country_population","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":149,"url":null},"def":{"name":"country_population","return_type":"Int32","visibility":"Public","body":"@country_population"}},{"html_id":"country_tld:String-instance-method","name":"country_tld","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":136,"url":null},"def":{"name":"country_tld","return_type":"String","visibility":"Public","body":"@country_tld"}},{"html_id":"currency:String-instance-method","name":"currency","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":145,"url":null},"def":{"name":"currency","return_type":"String","visibility":"Public","body":"@currency"}},{"html_id":"currency_name:String-instance-method","name":"currency_name","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":146,"url":null},"def":{"name":"currency_name","return_type":"String","visibility":"Public","body":"@currency_name"}},{"html_id":"in_eu:Bool-instance-method","name":"in_eu","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":138,"url":null},"def":{"name":"in_eu","return_type":"Bool","visibility":"Public","body":"@in_eu"}},{"html_id":"ip:String-instance-method","name":"ip","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":125,"url":null},"def":{"name":"ip","return_type":"String","visibility":"Public","body":"@ip"}},{"html_id":"languages:String-instance-method","name":"languages","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":147,"url":null},"def":{"name":"languages","return_type":"String","visibility":"Public","body":"@languages"}},{"html_id":"latitude:Float64-instance-method","name":"latitude","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":140,"url":null},"def":{"name":"latitude","return_type":"Float64","visibility":"Public","body":"@latitude"}},{"html_id":"longitude:Float64-instance-method","name":"longitude","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":141,"url":null},"def":{"name":"longitude","return_type":"Float64","visibility":"Public","body":"@longitude"}},{"html_id":"network:String-instance-method","name":"network","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":126,"url":null},"def":{"name":"network","return_type":"String","visibility":"Public","body":"@network"}},{"html_id":"org:String-instance-method","name":"org","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":151,"url":null},"def":{"name":"org","return_type":"String","visibility":"Public","body":"@org"}},{"html_id":"postal:String-instance-method","name":"postal","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":139,"url":null},"def":{"name":"postal","return_type":"String","visibility":"Public","body":"@postal"}},{"html_id":"region:String-instance-method","name":"region","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":129,"url":null},"def":{"name":"region","return_type":"String","visibility":"Public","body":"@region"}},{"html_id":"region_code:String-instance-method","name":"region_code","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":130,"url":null},"def":{"name":"region_code","return_type":"String","visibility":"Public","body":"@region_code"}},{"html_id":"timezone:String-instance-method","name":"timezone","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":142,"url":null},"def":{"name":"timezone","return_type":"String","visibility":"Public","body":"@timezone"}},{"html_id":"utc_offset:String-instance-method","name":"utc_offset","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":143,"url":null},"def":{"name":"utc_offset","return_type":"String","visibility":"Public","body":"@utc_offset"}},{"html_id":"version:String-instance-method","name":"version","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":127,"url":null},"def":{"name":"version","return_type":"String","visibility":"Public","body":"@version"}}]},{"html_id":"ipapi-crystal/Ipapi/PageNotFoundException","path":"Ipapi/PageNotFoundException.html","kind":"class","full_name":"Ipapi::PageNotFoundException","name":"PageNotFoundException","abstract":false,"superclass":{"html_id":"ipapi-crystal/Ipapi/Error","kind":"class","full_name":"Ipapi::Error","name":"Error"},"ancestors":[{"html_id":"ipapi-crystal/Ipapi/Error","kind":"class","full_name":"Ipapi::Error","name":"Error"},{"html_id":"ipapi-crystal/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"ipapi-crystal/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/ipapi.cr","line_number":110,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"ipapi-crystal/Ipapi","kind":"module","full_name":"Ipapi","name":"Ipapi"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":111,"url":null},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]},{"html_id":"ipapi-crystal/Ipapi/RateLimitedException","path":"Ipapi/RateLimitedException.html","kind":"class","full_name":"Ipapi::RateLimitedException","name":"RateLimitedException","abstract":false,"superclass":{"html_id":"ipapi-crystal/Ipapi/Error","kind":"class","full_name":"Ipapi::Error","name":"Error"},"ancestors":[{"html_id":"ipapi-crystal/Ipapi/Error","kind":"class","full_name":"Ipapi::Error","name":"Error"},{"html_id":"ipapi-crystal/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"ipapi-crystal/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"ipapi-crystal/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/ipapi.cr","line_number":116,"url":null}],"repository_name":"ipapi-crystal","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"ipapi-crystal/Ipapi","kind":"module","full_name":"Ipapi","name":"Ipapi"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/ipapi.cr","line_number":117,"url":null},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}]}]}]}}) \ No newline at end of file