Class: Cocoadex::DocSet

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoadex/models/docset.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plist_path) ⇒ DocSet

Returns a new instance of DocSet.



6
7
8
9
10
11
12
13
# File 'lib/cocoadex/models/docset.rb', line 6

def initialize plist_path
  doc = Nokogiri::HTML(IO.read(plist_path))
  @path = plist_path
  @name = plist_value doc, 'CFBundleName'
  @platform = plist_value doc, "DocSetPlatformFamily"
  @version = plist_value doc, "DocSetPlatformVersion"
  @description = plist_value doc, "DocSetDescription"
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/cocoadex/models/docset.rb', line 4

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/cocoadex/models/docset.rb', line 4

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/cocoadex/models/docset.rb', line 4

def path
  @path
end

#platformObject (readonly)

Returns the value of attribute platform.



4
5
6
# File 'lib/cocoadex/models/docset.rb', line 4

def platform
  @platform
end

#versionObject (readonly)

Returns the value of attribute version.



4
5
6
# File 'lib/cocoadex/models/docset.rb', line 4

def version
  @version
end

Instance Method Details

#inspectObject



15
16
17
# File 'lib/cocoadex/models/docset.rb', line 15

def inspect
  "<DocSet #{name} @description=#{description} @path=#{path}>"
end