Class: IP2Country::Country

Inherits:
Object
  • Object
show all
Defined in:
lib/ip2country/country.rb

Overview

IP2Country represents a country of a matching IP returned by IP2Country#lookup.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cc, ccc, name) ⇒ Country



6
7
8
9
10
# File 'lib/ip2country/country.rb', line 6

def initialize(cc, ccc, name)
  @cc   = cc.to_s
  @ccc  = ccc.to_s
  @name = name.to_s
end

Instance Attribute Details

#ccObject (readonly) Also known as: code2, country_code2

Returns the value of attribute cc.



4
5
6
# File 'lib/ip2country/country.rb', line 4

def cc
  @cc
end

#cccObject (readonly) Also known as: code3, country_code3

Returns the value of attribute ccc.



4
5
6
# File 'lib/ip2country/country.rb', line 4

def ccc
  @ccc
end

#nameObject (readonly) Also known as: country_name

Returns the value of attribute name.



4
5
6
# File 'lib/ip2country/country.rb', line 4

def name
  @name
end