Class: TimezoneDetection::IpTimezone

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
IpConvertion
Defined in:
app/models/timezone_detection/ip_timezone.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from IpConvertion

ip2long, long2ip

Instance Attribute Details

#ipObject

Returns the value of attribute ip.



6
7
8
# File 'app/models/timezone_detection/ip_timezone.rb', line 6

def ip
  @ip
end

Class Method Details

.find_ip(ip) ⇒ Object



10
11
12
# File 'app/models/timezone_detection/ip_timezone.rb', line 10

def self.find_ip(ip)
    IpTimezone.where(ip_in_longint: IpTimezone.ip2long(ip))
end