Sha256: 73d9881cc4d607b522b4a96219ac88e5bede75b4a5c14f9d5e46210b644b5846
Contents?: true
Size: 675 Bytes
Versions: 7
Compression:
Stored size: 675 Bytes
Contents
module Vnstat module Traffic ## # A class encapsulating monthly tracking information. class Monthly < Base ## # Fetches a single {Result::Month} from the collection. # # @param [Integer] year # @param [Integer] month # @return [Result::Month] def [](year, month) entries_hash[[year, month]] end private def entries_hash elements = traffic_data.xpath('months/month') elements.each_with_object({}) do |element, hash| result = Result::Month.extract_from_xml_element(element) hash[[result.year, result.month]] = result end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems