Class: Autometal::Geoip::Organization

Inherits:
Package
  • Object
show all
Defined in:
lib/geoip/organization.rb

Overview

GeoIPOrg database extension

provides Country and Organization (ISP) information

Instance Attribute Summary collapse

Attributes inherited from Package

#version

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Package

#initialize, installed?, #lookup

Constructor Details

This class inherits a constructor from Autometal::Geoip::Package

Instance Attribute Details

#organizationObject

Returns the value of attribute organization.



8
9
10
# File 'lib/geoip/organization.rb', line 8

def organization
  @organization
end

Class Method Details

.data_fileObject



10
11
12
# File 'lib/geoip/organization.rb', line 10

def self.data_file
  File.join(Geoip::DATA_FILE_PATH,"GeoIPOrg.dat")
end

Instance Method Details

#process_responseObject



14
15
16
17
18
# File 'lib/geoip/organization.rb', line 14

def process_response
  ar = @response.split(": ")
  @version = ar[0].strip
  @organization = ar[1].strip
end