You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
eznet-cli/ltnp/ltnp_operator.cr

17 lines
350 B
Crystal

require "./ltnp_record"
class LtnpOperator
def initialize(_cmd_output : String)
@cmd_output = _cmd_output
records = @cmd_output.each_line
records = records.each.select(/^tcp/)
@ltnp_records = Array(LtnpRecord).new
records.each { |s| @ltnp_records << LtnpRecord.new s }
end
def say_hi
puts @cmd_output
puts @ltnp_records.to_s
end
end