Class: Reservation

Inherits:
Object
  • Object
show all
Defined in:
lib/msdhcpdump/reservation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reserve = []) ⇒ Reservation

Returns a new instance of Reservation.



3
4
5
6
7
8
9
# File 'lib/msdhcpdump/reservation.rb', line 3

def initialize(reserve=[])
  @ip = reserve[0]
  @mac = reserve[1]
  @hostname = reserve[2]
  @comment = reserve[3]
  @option = reserve[4]
end

Instance Attribute Details

#commentObject

Returns the value of attribute comment.



2
3
4
# File 'lib/msdhcpdump/reservation.rb', line 2

def comment
  @comment
end

#hostnameObject

Returns the value of attribute hostname.



2
3
4
# File 'lib/msdhcpdump/reservation.rb', line 2

def hostname
  @hostname
end

#ipObject

Returns the value of attribute ip.



2
3
4
# File 'lib/msdhcpdump/reservation.rb', line 2

def ip
  @ip
end

#macObject

Returns the value of attribute mac.



2
3
4
# File 'lib/msdhcpdump/reservation.rb', line 2

def mac
  @mac
end

#optionObject

Returns the value of attribute option.



2
3
4
# File 'lib/msdhcpdump/reservation.rb', line 2

def option
  @option
end

Instance Method Details

#to_sObject



10
11
12
# File 'lib/msdhcpdump/reservation.rb', line 10

def to_s
  return "#{@ip} - #{@mac} - #{@hostname} - #{@comment} - #{@option}\n"
end