Class: Suppository::DpkgDebLine
- Inherits:
-
Object
- Object
- Suppository::DpkgDebLine
- Defined in:
- lib/suppository/dpkg_deb_line.rb
Constant Summary collapse
- DESCRIPTION_FIELD =
'Description'
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(line) ⇒ DpkgDebLine
constructor
A new instance of DpkgDebLine.
Constructor Details
#initialize(line) ⇒ DpkgDebLine
Returns a new instance of DpkgDebLine.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/suppository/dpkg_deb_line.rb', line 7 def initialize(line) field = split_line(line) if description?(line) @attributes = { DESCRIPTION_FIELD => line } elsif field @attributes = { field['fieldname'] => field['fieldvalue'] } else fail "can't parse line - '#{line}'" end end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/suppository/dpkg_deb_line.rb', line 5 def attributes @attributes end |