mirror of
https://github.com/cliffe/SecGen.git
synced 2026-02-23 04:08:02 +00:00
33 lines
813 B
Ruby
33 lines
813 B
Ruby
class Network
|
|
attr_accessor :name, :range
|
|
|
|
# Initialise object
|
|
# @param [String] name network name
|
|
# @param [String] range network range
|
|
def initialize(name="", range="")
|
|
@name = name
|
|
@range = range
|
|
end
|
|
|
|
# Returns a string containing all object variables concatenated together
|
|
# @return [String] hash contains all object variables
|
|
def id
|
|
hash = @name + @range
|
|
return hash
|
|
# return string that connects everything to 1 massive string
|
|
end
|
|
|
|
# Check if name matches networks.xml from scenario.xml
|
|
# @param other ??????????
|
|
def eql? other
|
|
# checks if name matches networks.xml from scenario.xml
|
|
other.kind_of?(self.class) && @name == other.name
|
|
end
|
|
|
|
# Returns a hash of the type
|
|
# @return [Hash] hash of the type ????????
|
|
def hash
|
|
@type.hash
|
|
end
|
|
|
|
end |