Sha256: 964647c0984cdb75b04b89f820aa5596a7c9569c30d6049b91f6df3b7d8f914c

Contents?: true

Size: 685 Bytes

Versions: 9

Compression:

Stored size: 685 Bytes

Contents

module Nanaimo
  # A Plist.
  #
  class Plist
    # @return [Nanaimo::Object] The root level object in the plist.
    #
    attr_accessor :root_object

    # @return [String] The encoding of the plist.
    #
    attr_accessor :file_type

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

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

    def hash
      root_object.hash
    end

    # @return A native Ruby object representation of the plist.
    #
    def as_ruby
      root_object.as_ruby
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
nanaimo-0.2.3 lib/nanaimo/plist.rb
nanaimo-0.2.2 lib/nanaimo/plist.rb
nanaimo-0.2.1 lib/nanaimo/plist.rb
nanaimo-0.2.0 lib/nanaimo/plist.rb
nanaimo-0.1.4 lib/nanaimo/plist.rb
nanaimo-0.1.3 lib/nanaimo/plist.rb
nanaimo-0.1.2 lib/nanaimo/plist.rb
nanaimo-0.1.1 lib/nanaimo/plist.rb
nanaimo-0.1.0 lib/nanaimo/plist.rb