Class: Ip2address::Core
- Inherits:
-
Object
- Object
- Ip2address::Core
- Defined in:
- lib/ip2address/core.rb
Constant Summary collapse
- IP_SEARCH_URL =
"http://ip.taobao.com/service/getIpInfo.php"
Instance Attribute Summary collapse
-
#area ⇒ Object
Returns the value of attribute area.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#ip ⇒ Object
Returns the value of attribute ip.
-
#isp ⇒ Object
Returns the value of attribute isp.
-
#region ⇒ Object
Returns the value of attribute region.
Instance Method Summary collapse
-
#initialize(ip) ⇒ Core
constructor
A new instance of Core.
Constructor Details
#initialize(ip) ⇒ Core
Returns a new instance of Core.
10 11 12 13 14 |
# File 'lib/ip2address/core.rb', line 10 def initialize(ip) @ip = ip fetch_info_by_ip end |
Instance Attribute Details
#area ⇒ Object
Returns the value of attribute area.
8 9 10 |
# File 'lib/ip2address/core.rb', line 8 def area @area end |
#city ⇒ Object
Returns the value of attribute city.
8 9 10 |
# File 'lib/ip2address/core.rb', line 8 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
8 9 10 |
# File 'lib/ip2address/core.rb', line 8 def country @country end |
#ip ⇒ Object
Returns the value of attribute ip.
8 9 10 |
# File 'lib/ip2address/core.rb', line 8 def ip @ip end |
#isp ⇒ Object
Returns the value of attribute isp.
8 9 10 |
# File 'lib/ip2address/core.rb', line 8 def isp @isp end |
#region ⇒ Object
Returns the value of attribute region.
8 9 10 |
# File 'lib/ip2address/core.rb', line 8 def region @region end |