Class: Linux::Lxc::Line
- Inherits:
-
Object
- Object
- Linux::Lxc::Line
- Defined in:
- lib/linux/lxc.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#lxc ⇒ Object
readonly
Returns the value of attribute lxc.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #file ⇒ Object
-
#initialize(lxc, key, value) ⇒ Line
constructor
A new instance of Line.
- #to_s ⇒ Object
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
#key ⇒ Object (readonly)
Returns the value of attribute key.
7 8 9 |
# File 'lib/linux/lxc.rb', line 7 def key @key end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
7 8 9 |
# File 'lib/linux/lxc.rb', line 7 def line @line end |
#lxc ⇒ Object (readonly)
Returns the value of attribute lxc.
7 8 9 |
# File 'lib/linux/lxc.rb', line 7 def lxc @lxc end |
#value ⇒ Object
Returns the value of attribute value.
8 9 10 |
# File 'lib/linux/lxc.rb', line 8 def value @value end |
Instance Method Details
#file ⇒ Object
15 16 17 |
# File 'lib/linux/lxc.rb', line 15 def file @lxc.file end |
#to_s ⇒ Object
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 |