Class: Nanaimo::Plist

Inherits:
Object
  • Object
show all
Defined in:
lib/nanaimo/plist.rb

Overview

A Plist.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root_object = nil, file_type = nil) ⇒ Plist

Returns a new instance of Plist.


15
16
17
18
# File 'lib/nanaimo/plist.rb', line 15

def initialize(root_object = nil, file_type = nil)
  @root_object = root_object
  @file_type = file_type
end

Instance Attribute Details

#file_typeString

Returns The encoding of the plist.

Returns:

  • (String)

    The encoding of the plist.


13
14
15
# File 'lib/nanaimo/plist.rb', line 13

def file_type
  @file_type
end

#root_objectNanaimo::Object

Returns The root level object in the plist.

Returns:


9
10
11
# File 'lib/nanaimo/plist.rb', line 9

def root_object
  @root_object
end

Instance Method Details

#==(other) ⇒ Object


20
21
22
23
# File 'lib/nanaimo/plist.rb', line 20

def ==(other)
  return unless other.is_a?(Nanaimo::Plist)
  file_type == other.file_type && root_object == other.root_object
end

#as_rubyObject

Returns A native Ruby object representation of the plist.

Returns:

  • A native Ruby object representation of the plist.


31
32
33
# File 'lib/nanaimo/plist.rb', line 31

def as_ruby
  root_object.as_ruby
end

#hashObject


25
26
27
# File 'lib/nanaimo/plist.rb', line 25

def hash
  root_object.hash
end