Class: Vnstat::Traffic::Base
- Inherits:
-
Object
- Object
- Vnstat::Traffic::Base
- Includes:
- Enumerable
- Defined in:
- lib/vnstat/traffic/base.rb
Overview
An abstract implementation for a traffic collection.
Instance Attribute Summary collapse
-
#interface ⇒ Interface
readonly
The tracked interface.
Instance Method Summary collapse
-
#each(&block) ⇒ Object
Iterates over all results in the collection.
-
#initialize(interface) ⇒ Base
constructor
Initializes the traffic collection.
Constructor Details
#initialize(interface) ⇒ Base
Initializes the traffic collection.
18 19 20 |
# File 'lib/vnstat/traffic/base.rb', line 18 def initialize(interface) @interface = interface end |
Instance Attribute Details
#interface ⇒ Interface (readonly)
The tracked interface.
9 10 11 |
# File 'lib/vnstat/traffic/base.rb', line 9 def interface @interface end |
Instance Method Details
#each ⇒ Enumerator #each {|result| ... } ⇒ Base
Iterates over all results in the collection.
32 33 34 |
# File 'lib/vnstat/traffic/base.rb', line 32 def each(&block) entries_hash.values.each(&block) end |