Module: Vnstat
- Defined in:
- lib/vnstat.rb,
lib/vnstat/error.rb,
lib/vnstat/utils.rb,
lib/vnstat/parser.rb,
lib/vnstat/result.rb,
lib/vnstat/traffic.rb,
lib/vnstat/version.rb,
lib/vnstat/document.rb,
lib/vnstat/interface.rb,
lib/vnstat/result/day.rb,
lib/vnstat/result/hour.rb,
lib/vnstat/result/month.rb,
lib/vnstat/traffic/base.rb,
lib/vnstat/traffic/tops.rb,
lib/vnstat/configuration.rb,
lib/vnstat/result/minute.rb,
lib/vnstat/traffic/daily.rb,
lib/vnstat/traffic/hourly.rb,
lib/vnstat/traffic/monthly.rb,
lib/vnstat/interface_collection.rb,
lib/vnstat/result/date_delegation.rb,
lib/vnstat/result/time_comparable.rb,
lib/vnstat/errors/unknown_interface.rb,
lib/vnstat/errors/executable_not_found.rb
Overview
The Vnstat namespace.
Defined Under Namespace
Modules: Parser, Traffic, Utils Classes: Configuration, Document, Error, ExecutableNotFound, Interface, InterfaceCollection, Result, UnknownInterface
Constant Summary collapse
- VERSION =
'3.0.7'
Class Method Summary collapse
-
.[](id) ⇒ Interface
Returns traffic information for the given interface.
-
.cli_version ⇒ String
Returns information for the currently installed version of vnstat.
-
.config ⇒ Configuration
The configuration of the Vnstat environment.
-
.configure {|config| ... } ⇒ Configuration
Configures the Vnstat environment.
-
.interfaces ⇒ InterfaceCollection
Returns traffic information for all known interfaces.
Class Method Details
.[](id) ⇒ Interface
Returns traffic information for the given interface.
49 50 51 |
# File 'lib/vnstat.rb', line 49 def [](id) interfaces[id] end |
.cli_version ⇒ String
Returns information for the currently installed version of vnstat.
65 66 67 |
# File 'lib/vnstat.rb', line 65 def cli_version Utils.call_executable('-v') end |
.config ⇒ Configuration
The configuration of the Vnstat environment.
30 31 32 |
# File 'lib/vnstat.rb', line 30 def config @config ||= Configuration.new end |
.configure {|config| ... } ⇒ Configuration
Configures the Vnstat environment.
39 40 41 42 |
# File 'lib/vnstat.rb', line 39 def configure yield(config) config end |
.interfaces ⇒ InterfaceCollection
Returns traffic information for all known interfaces.
57 58 59 |
# File 'lib/vnstat.rb', line 57 def interfaces InterfaceCollection.open end |