Sha256: 923df2bb8ef73798f5990c7451012d6e8799d98cb9c273b7fc2119800864d2f5
Contents?: true
Size: 868 Bytes
Versions: 2
Compression:
Stored size: 868 Bytes
Contents
module Vnstat module Traffic ## # An abstract implementation for a traffic collection. # # @attr_reader [Interface] interface The tracked interface. class Base include Enumerable attr_reader :interface ## # Initializes the traffic collection. # # @param [Interface] interface The tracked interface. def initialize(interface) @interface = interface end ## # Iterates over all results in the collection. # # @overload each # @return [Enumerator] # # @overload each(&block) # @yield [result] # @yieldparam [Result] result # @return [Base] def each(&block) entries_hash.values.each(&block) end private def traffic_data interface.data.xpath('//traffic') end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
vnstat-ruby-1.1.0 | lib/vnstat/traffic/base.rb |
vnstat-ruby-1.0.5 | lib/vnstat/traffic/base.rb |