class InternetClass
Represents one usage-type
Public Instance Methods
in_limits?(login, today = Date.today)
click to toggle source
Checks whether a given user is in limits of InternetClasses
and thus allowed to use the internet
# File Entities/Internet.rb, line 31 def in_limits?(login, today = Date.today) return true if type == ['unlimited'] return true unless t = Network::Captive.traffic t.get_day(login, 1, today.to_time).flatten[0..1].inject(:+) < limit.to_i * 1_000_000 end