Class: Ip2address::Core

Inherits:
Object
  • Object
show all
Defined in:
lib/ip2address/core.rb

Constant Summary collapse

IP_SEARCH_URL =
"http://ip.taobao.com/service/getIpInfo.php"

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#areaObject

Returns the value of attribute area.



8
9
10
# File 'lib/ip2address/core.rb', line 8

def area
  @area
end

#cityObject

Returns the value of attribute city.



8
9
10
# File 'lib/ip2address/core.rb', line 8

def city
  @city
end

#countryObject

Returns the value of attribute country.



8
9
10
# File 'lib/ip2address/core.rb', line 8

def country
  @country
end

#ipObject

Returns the value of attribute ip.



8
9
10
# File 'lib/ip2address/core.rb', line 8

def ip
  @ip
end

#ispObject

Returns the value of attribute isp.



8
9
10
# File 'lib/ip2address/core.rb', line 8

def isp
  @isp
end

#regionObject

Returns the value of attribute region.



8
9
10
# File 'lib/ip2address/core.rb', line 8

def region
  @region
end