Class: IPT::Propertylist::Parser
- Inherits:
-
Object
- Object
- IPT::Propertylist::Parser
- Defined in:
- lib/ipt/plist.rb
Instance Method Summary collapse
-
#initialize(path) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(path) ⇒ Parser
Returns a new instance of Parser.
7 8 9 10 11 12 |
# File 'lib/ipt/plist.rb', line 7 def initialize(path) if File.file?(path) type = `file '#{path}'` @xml = type =~ /Apple binary property list/ ? `plutil -convert xml1 -o - '#{path}'` : path end end |
Instance Method Details
#parse ⇒ Object
14 15 16 |
# File 'lib/ipt/plist.rb', line 14 def parse ::Plist::parse_xml(@xml) if @xml end |