class Record

Attributes

class_type[RW]
domain[RW]

Create accessor methods

ip_address[RW]
record_type[RW]
time_out[RW]

Public Class Methods

new(array_record) click to toggle source
# File lib/record.rb, line 10
def initialize(array_record)

  # Initialize instance variables
  @domain = array_record[0]
  @time_out = array_record[1]
  @class_type = array_record[2]
  @record_type = array_record[3]

  # MX Records have an extra column before the IP Address block
  if @class_type.eql?("MX")
    @ip_address = array_record[5]
  else
    @ip_address = array_record[4]
  end

  if @ip_address.include?("\n")
    @ip_address.delete!("\n") # Removes the "\n" character from the ip address
  end

end