Class: Vnstat::Traffic::Daily
Overview
A class encapsulating daily tracking information.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#[](*args) ⇒ Result::Day
Fetches a single Result::Day from the collection.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Vnstat::Traffic::Base
Instance Method Details
#[](date) ⇒ Result::Day #[](year, month, day) ⇒ Result::Day
Fetches a single Result::Day from the collection.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/vnstat/traffic/daily.rb', line 20 def [](*args) date = case args.count when 1 then args.first when 3 then Date.new(*args) else raise ArgumentError, 'wrong number of arguments ' \ "(#{args.count} for 1 or 3)" end entries_hash[date] end |