Class: Linux::Lxc::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/linux/lxc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lxc, key, value) ⇒ Line

Returns a new instance of Line.



9
10
11
12
13
14
# File 'lib/linux/lxc.rb', line 9

def initialize(lxc, key, value)
  @lxc = lxc
  @line = lxc.lines.add(self).length
  @key = key
  @value = value
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



7
8
9
# File 'lib/linux/lxc.rb', line 7

def key
  @key
end

#lineObject (readonly)

Returns the value of attribute line.



7
8
9
# File 'lib/linux/lxc.rb', line 7

def line
  @line
end

#lxcObject (readonly)

Returns the value of attribute lxc.



7
8
9
# File 'lib/linux/lxc.rb', line 7

def lxc
  @lxc
end

#valueObject

Returns the value of attribute value.



8
9
10
# File 'lib/linux/lxc.rb', line 8

def value
  @value
end

Instance Method Details

#fileObject



15
16
17
# File 'lib/linux/lxc.rb', line 15

def file
  @lxc.file
end

#to_sObject



18
19
20
21
22
23
24
# File 'lib/linux/lxc.rb', line 18

def to_s
  if value
    "#{key} = #{value}"
  else
    key
  end
end