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.



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

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.



11
12
13
# File 'lib/nanaimo/plist.rb', line 11

def file_type
  @file_type
end

#root_objectNanaimo::Object

Returns The root level object in the plist.

Returns:



7
8
9
# File 'lib/nanaimo/plist.rb', line 7

def root_object
  @root_object
end

Instance Method Details

#==(other) ⇒ Object



18
19
20
21
# File 'lib/nanaimo/plist.rb', line 18

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.



29
30
31
# File 'lib/nanaimo/plist.rb', line 29

def as_ruby
  root_object.as_ruby
end

#hashObject



23
24
25
# File 'lib/nanaimo/plist.rb', line 23

def hash
  root_object.hash
end