Skip to content

Instantly share code, notes, and snippets.

@semaj
Forked from tpendragon/gist:75ec03ddf10542d8e463
Last active August 29, 2015 14:05
Show Gist options
  • Save semaj/0a0f6e4e6ef1e3e6f8ee to your computer and use it in GitHub Desktop.
Save semaj/0a0f6e4e6ef1e3e6f8ee to your computer and use it in GitHub Desktop.
module DynamicNetworkGraph
class NetworkFlow
attr_accessor :srcAddr, :dstAddr, :srcPort, :dstPort, :protocol, :start, :end, :packets, :transferred, :status
def fromFields(sep, line)
line.split(sep).zip(instance_variables).each { |val, name| instance_variable_set(name, val) }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment