Class: Reservation
- Inherits:
-
Object
- Object
- Reservation
- Defined in:
- lib/msdhcpdump/reservation.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#ip ⇒ Object
Returns the value of attribute ip.
-
#mac ⇒ Object
Returns the value of attribute mac.
-
#option ⇒ Object
Returns the value of attribute option.
Instance Method Summary collapse
-
#initialize(reserve = []) ⇒ Reservation
constructor
A new instance of Reservation.
- #to_s ⇒ Object
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
#comment ⇒ Object
Returns the value of attribute comment.
2 3 4 |
# File 'lib/msdhcpdump/reservation.rb', line 2 def comment @comment end |
#hostname ⇒ Object
Returns the value of attribute hostname.
2 3 4 |
# File 'lib/msdhcpdump/reservation.rb', line 2 def hostname @hostname end |
#ip ⇒ Object
Returns the value of attribute ip.
2 3 4 |
# File 'lib/msdhcpdump/reservation.rb', line 2 def ip @ip end |
#mac ⇒ Object
Returns the value of attribute mac.
2 3 4 |
# File 'lib/msdhcpdump/reservation.rb', line 2 def mac @mac end |
#option ⇒ Object
Returns the value of attribute option.
2 3 4 |
# File 'lib/msdhcpdump/reservation.rb', line 2 def option @option end |
Instance Method Details
#to_s ⇒ Object
10 11 12 |
# File 'lib/msdhcpdump/reservation.rb', line 10 def to_s return "#{@ip} - #{@mac} - #{@hostname} - #{@comment} - #{@option}\n" end |