Sha256: 4e9f497dc5e41f2dc2ad53a7c1022782a07a2ade755c253fe95c853280caa73c

Contents?: true

Size: 716 Bytes

Versions: 7

Compression:

Stored size: 716 Bytes

Contents

# frozen_string_literal: true

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

7 entries across 7 versions & 2 rubygems

Version Path
nanaimo-0.4.0 lib/nanaimo/plist.rb
nanaimo-0.3.0 lib/nanaimo/plist.rb
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/nanaimo-0.2.6/lib/nanaimo/plist.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/nanaimo-0.2.6/lib/nanaimo/plist.rb
nanaimo-0.2.6 lib/nanaimo/plist.rb
nanaimo-0.2.5 lib/nanaimo/plist.rb
nanaimo-0.2.4 lib/nanaimo/plist.rb