Class: Masklen::LookupResult
- Inherits:
-
Struct
- Object
- Struct
- Masklen::LookupResult
- Defined in:
- lib/masklen/types.rb
Overview
The primary result returned for a single IP lookup.
Instance Attribute Summary collapse
-
#ip ⇒ Object
Returns the value of attribute ip.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#location ⇒ Object
Returns the value of attribute location.
-
#network ⇒ Object
Returns the value of attribute network.
-
#privacy ⇒ Object
Returns the value of attribute privacy.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Build a LookupResult from a parsed JSON hash.
Instance Attribute Details
#ip ⇒ Object
Returns the value of attribute ip
101 102 103 |
# File 'lib/masklen/types.rb', line 101 def ip @ip end |
#locale ⇒ Object
Returns the value of attribute locale
101 102 103 |
# File 'lib/masklen/types.rb', line 101 def locale @locale end |
#location ⇒ Object
Returns the value of attribute location
101 102 103 |
# File 'lib/masklen/types.rb', line 101 def location @location end |
#network ⇒ Object
Returns the value of attribute network
101 102 103 |
# File 'lib/masklen/types.rb', line 101 def network @network end |
#privacy ⇒ Object
Returns the value of attribute privacy
101 102 103 |
# File 'lib/masklen/types.rb', line 101 def privacy @privacy end |
Class Method Details
.from_hash(hash) ⇒ Object
Build a LookupResult from a parsed JSON hash.
110 111 112 113 114 115 116 117 118 |
# File 'lib/masklen/types.rb', line 110 def self.from_hash(hash) new( ip: hash["ip"], location: Location.from_hash(hash["location"]), network: Network.from_hash(hash["network"]), privacy: Privacy.from_hash(hash["privacy"]), locale: Locale.from_hash(hash["locale"]) ) end |