rb-scpt 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES +497 -0
  3. data/doc/aem-manual/01_introduction.html +60 -0
  4. data/doc/aem-manual/02_apioverview.html +107 -0
  5. data/doc/aem-manual/03_packingandunpackingdata.html +135 -0
  6. data/doc/aem-manual/04_references.html +409 -0
  7. data/doc/aem-manual/05_targetingapplications.html +164 -0
  8. data/doc/aem-manual/06_buildingandsendingevents.html +229 -0
  9. data/doc/aem-manual/07_findapp.html +63 -0
  10. data/doc/aem-manual/08_examples.html +94 -0
  11. data/doc/aem-manual/aemreferenceinheritance.gif +0 -0
  12. data/doc/aem-manual/index.html +56 -0
  13. data/doc/appscript-manual/01_introduction.html +94 -0
  14. data/doc/appscript-manual/02_aboutappscripting.html +247 -0
  15. data/doc/appscript-manual/03_quicktutorial.html +167 -0
  16. data/doc/appscript-manual/04_gettinghelp.html +188 -0
  17. data/doc/appscript-manual/05_keywordconversion.html +106 -0
  18. data/doc/appscript-manual/06_classesandenums.html +192 -0
  19. data/doc/appscript-manual/07_applicationobjects.html +211 -0
  20. data/doc/appscript-manual/08_realvsgenericreferences.html +96 -0
  21. data/doc/appscript-manual/09_referenceforms.html +241 -0
  22. data/doc/appscript-manual/10_referenceexamples.html +154 -0
  23. data/doc/appscript-manual/11_applicationcommands.html +245 -0
  24. data/doc/appscript-manual/12_commandexamples.html +138 -0
  25. data/doc/appscript-manual/13_performanceissues.html +142 -0
  26. data/doc/appscript-manual/14_notes.html +80 -0
  27. data/doc/appscript-manual/application_architecture.gif +0 -0
  28. data/doc/appscript-manual/application_architecture2.gif +0 -0
  29. data/doc/appscript-manual/finder_to_textedit_event.gif +0 -0
  30. data/doc/appscript-manual/index.html +62 -0
  31. data/doc/appscript-manual/relationships_example.gif +0 -0
  32. data/doc/appscript-manual/ruby_to_itunes_event.gif +0 -0
  33. data/doc/full.css +106 -0
  34. data/doc/index.html +45 -0
  35. data/doc/mactypes-manual/01_introduction.html +54 -0
  36. data/doc/mactypes-manual/02_aliasclass.html +124 -0
  37. data/doc/mactypes-manual/03_fileurlclass.html +126 -0
  38. data/doc/mactypes-manual/04_unitsclass.html +100 -0
  39. data/doc/mactypes-manual/index.html +53 -0
  40. data/doc/osax-manual/01_introduction.html +67 -0
  41. data/doc/osax-manual/02_interface.html +147 -0
  42. data/doc/osax-manual/03_examples.html +73 -0
  43. data/doc/osax-manual/04_notes.html +61 -0
  44. data/doc/osax-manual/index.html +53 -0
  45. data/doc/rb-appscript-logo.png +0 -0
  46. data/extconf.rb +65 -0
  47. data/rb-scpt.gemspec +14 -0
  48. data/sample/AB_export_vcard.rb +31 -0
  49. data/sample/AB_list_people_with_emails.rb +13 -0
  50. data/sample/Add_iCal_event.rb +21 -0
  51. data/sample/Create_daily_iCal_todos.rb +75 -0
  52. data/sample/Export_Address_Book_phone_numbers.rb +59 -0
  53. data/sample/Hello_world.rb +21 -0
  54. data/sample/List_iTunes_playlist_names.rb +11 -0
  55. data/sample/Make_Mail_message.rb +33 -0
  56. data/sample/Open_file_in_TextEdit.rb +13 -0
  57. data/sample/Organize_Mail_messages.rb +61 -0
  58. data/sample/Print_folder_tree.rb +16 -0
  59. data/sample/Select_all_HTML_files.rb +14 -0
  60. data/sample/Set_iChat_status.rb +24 -0
  61. data/sample/Simple_Finder_GUI_Scripting.rb +18 -0
  62. data/sample/Stagger_Finder_windows.rb +25 -0
  63. data/sample/TextEdit_demo.rb +130 -0
  64. data/sample/iTunes_top40_to_html.rb +71 -0
  65. data/src/SendThreadSafe.c +380 -0
  66. data/src/SendThreadSafe.h +139 -0
  67. data/src/lib/_aem/aemreference.rb +1022 -0
  68. data/src/lib/_aem/codecs.rb +662 -0
  69. data/src/lib/_aem/connect.rb +205 -0
  70. data/src/lib/_aem/encodingsupport.rb +77 -0
  71. data/src/lib/_aem/findapp.rb +85 -0
  72. data/src/lib/_aem/mactypes.rb +251 -0
  73. data/src/lib/_aem/send.rb +279 -0
  74. data/src/lib/_aem/typewrappers.rb +59 -0
  75. data/src/lib/_appscript/defaultterminology.rb +277 -0
  76. data/src/lib/_appscript/referencerenderer.rb +245 -0
  77. data/src/lib/_appscript/reservedkeywords.rb +116 -0
  78. data/src/lib/_appscript/safeobject.rb +249 -0
  79. data/src/lib/_appscript/terminology.rb +471 -0
  80. data/src/lib/aem.rb +253 -0
  81. data/src/lib/appscript.rb +1075 -0
  82. data/src/lib/kae.rb +1489 -0
  83. data/src/lib/osax.rb +659 -0
  84. data/src/rbae.c +979 -0
  85. data/test/README +3 -0
  86. data/test/test_aemreference.rb +118 -0
  87. data/test/test_appscriptcommands.rb +152 -0
  88. data/test/test_appscriptreference.rb +106 -0
  89. data/test/test_codecs.rb +186 -0
  90. data/test/test_findapp.rb +26 -0
  91. data/test/test_mactypes.rb +79 -0
  92. data/test/test_osax.rb +54 -0
  93. data/test/testall.sh +10 -0
  94. metadata +145 -0
@@ -0,0 +1,45 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+
5
+ <title>rb-appscript manual | Index</title>
6
+
7
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
8
+ <style type="text/css" media="all"><!--@import url(full.css);--></style>
9
+
10
+ </head>
11
+ <body>
12
+
13
+ <h1><img src="rb-appscript-logo.png" alt="rb-appscript" title="rb-appscript" /></h1>
14
+
15
+ <!-- top navigation -->
16
+ <div class="navbar">
17
+ &nbsp;
18
+
19
+ <span>
20
+ <a href="appscript-manual/index.html">appscript</a> /
21
+ <a href="mactypes-manual/index.html">mactypes</a> /
22
+ <a href="osax-manual/index.html">osax</a> /
23
+ <a href="aem-manual/index.html">aem</a>
24
+ </span>
25
+ </div>
26
+
27
+
28
+ <!-- content -->
29
+ <div id="content">
30
+
31
+ <h2>Manuals</h2>
32
+
33
+ <ul>
34
+ <li><a href="appscript-manual/index.html">rb-appscript</a> - high-level, user-friendly Apple event bridge</li>
35
+ <li><a href="mactypes-manual/index.html">rb-mactypes</a> - extra classes representing file and unit types</li>
36
+ <li><a href="osax-manual/index.html">rb-osax</a> - scripting addition support</li>
37
+ <li><a href="aem-manual/index.html">rb-aem</a> - lower-level interface to Mac OS X's Apple Event Manager</li>
38
+ </ul>
39
+
40
+ </div>
41
+
42
+ <div class="footer">&nbsp;</div>
43
+
44
+ </body>
45
+ </html>
@@ -0,0 +1,54 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+
5
+ <title>rb-mactypes manual | 1. Introduction</title>
6
+
7
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
8
+ <style type="text/css" media="all"><!--@import url(../full.css);--></style>
9
+
10
+ </head>
11
+ <body>
12
+
13
+ <h1><img src="../rb-appscript-logo.png" alt="rb-appscript" title="rb-appscript" /></h1>
14
+
15
+ <!-- top navigation -->
16
+ <div class="navbar">
17
+ <a href="index.html">Previous</a> &bull;
18
+ <a href="index.html">Up</a> &bull;
19
+ <a href="02_aliasclass.html">Next</a>
20
+
21
+ <span>
22
+ <a href="../appscript-manual/index.html">appscript</a> /
23
+ <strong><a href="../mactypes-manual/index.html">mactypes</a></strong> /
24
+ <a href="../osax-manual/index.html">osax</a> /
25
+ <a href="../aem-manual/index.html">aem</a>
26
+ </span>
27
+ </div>
28
+
29
+ <!-- content -->
30
+ <div id="content">
31
+ <h2>1. Introduction</h2>
32
+
33
+ <h3>About MacTypes</h3>
34
+
35
+ <p>The <code> MacTypes</code> module provides user-friendly wrappers for Apple event descriptors that do not have direct equivalents in the Ruby language. It contains Ruby classes for specifying filesystem objects and locations, and unit type values (lengths, weights, etc.), and is used in conjunction with the <code>Appscript</code>, <code>OSAX</code> and/or <code>AEM</code> modules. It is automatically imported when requiring appscript, aem or osax.</p>
36
+
37
+
38
+ <h3>Notes</h3>
39
+
40
+ <p>Be aware that most scriptable applications do not use or understand POSIX paths, and while the Apple Event Manager does provide some built-in coercions for converting between path strings and alias/file objects, these work with HFS paths only. Therefore, when specifying files and folders to scriptable applications, use <code>MacTypes::Alias</code> and <code>MacTypes::FileURL</code> objects - not path strings - unless otherwise indicated.</p>
41
+
42
+
43
+ </div>
44
+
45
+ <!-- bottom navigation -->
46
+
47
+ <div class="footer">
48
+ <a href="index.html">Previous</a> &bull;
49
+ <a href="index.html">Up</a> &bull;
50
+ <a href="02_aliasclass.html">Next</a>
51
+ </div>
52
+
53
+ </body>
54
+ </html>
@@ -0,0 +1,124 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+
5
+ <title>rb-mactypes manual | 2. Alias class</title>
6
+
7
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
8
+ <style type="text/css" media="all"><!--@import url(../full.css);--></style>
9
+
10
+ </head>
11
+ <body>
12
+
13
+ <h1><img src="../rb-appscript-logo.png" alt="rb-appscript" title="rb-appscript" /></h1>
14
+
15
+ <!-- top navigation -->
16
+ <div class="navbar">
17
+ <a href="01_introduction.html">Previous</a> &bull;
18
+ <a href="index.html">Up</a> &bull;
19
+ <a href="03_fileurlclass.html">Next</a>
20
+
21
+ <span>
22
+ <a href="../appscript-manual/index.html">appscript</a> /
23
+ <strong><a href="../mactypes-manual/index.html">mactypes</a></strong> /
24
+ <a href="../osax-manual/index.html">osax</a> /
25
+ <a href="../aem-manual/index.html">aem</a>
26
+ </span>
27
+ </div>
28
+
29
+ <!-- content -->
30
+ <div id="content">
31
+
32
+ <h2>2. The <code>MacTypes::Alias</code> class</h2>
33
+
34
+ <p>The <code>Alias</code> class represents a persistent reference to a filesystem object. Aliases keep track of filesystem objects even if they're renamed or moved to another location on the same disk.</p>
35
+
36
+
37
+ <h3>Methods</h3>
38
+
39
+ <pre><code>Alias -- a persistent reference to a filesystem object
40
+ Constructors:
41
+
42
+ Alias.path(path) -- make Alias object from POSIX path string
43
+
44
+ Alias.hfs_path(path) -- make Alias object from HFS path string
45
+
46
+ Alias.url(url) -- make Alias object from a local file:// URL string
47
+
48
+ Alias.desc(desc) -- make Alias object from an AE::AEDesc
49
+ of TypeAlias
50
+
51
+ Methods:
52
+
53
+ ==
54
+
55
+ hash
56
+
57
+ inspect
58
+
59
+ path -- returns POSIX path string to the object's current location
60
+
61
+ hfs_path -- returns HFS path string to the object's current location
62
+
63
+ url -- returns file:// URL string to the object's current location
64
+
65
+ desc -- returns AE::AEDesc of TypeAlias
66
+
67
+ to_s -- synonym for #path
68
+
69
+ to_alias -- returns self
70
+
71
+ to_file_url -- returns a MacTypes::FileURL object</code></pre>
72
+
73
+
74
+ <h3>Examples</h3>
75
+
76
+ <pre><code>require "appscript"
77
+
78
+ f = MacTypes::Alias.path('/Users/foo/some file')
79
+
80
+ puts f.to_s
81
+ # /Users/foo/some file
82
+
83
+ puts f.url
84
+ # file://localhost/Users/foo/some%20file
85
+
86
+ puts f.inspect
87
+ # MacTypes::Alias.path("/Users/foo/some file")
88
+
89
+ Appscript.app('TextEdit').open(f)
90
+ # opens document in TextEdit
91
+
92
+ MacTypes::Alias.path('/some/non/existent/location')
93
+ # File "/some/non/existent/location" not found.
94
+ # (MacTypes::FileNotFoundError)</code></pre>
95
+
96
+
97
+ <h3>Notes</h3>
98
+
99
+ <p>Comparing an <code>Alias</code> object against a <code>FileURL</code> object always returns false, even if both point to the same location.</p>
100
+
101
+ <p>Remember that aliases can change when the corresponding filesystem object is moved, so take care when using <code>Alias</code> objects in situations that involve comparing or hashing them (e.g. using aliases as <code>Hash</code> keys).</p>
102
+
103
+ </div>
104
+
105
+ <h3><code>MacTypes::FileNotFoundError</code></h3>
106
+
107
+ <p><code>FileNotFoundError</code> is a subclass of <code>RuntimeError</code>. It is raised by <code>Alias</code> and <code>FileURL</code> objects when an operation that only works for existing filesystem objects/locations fails. For example:</p>
108
+
109
+ <pre><code>require "appscript"
110
+
111
+ MacTypes::Alias.path('/some/non/existent/location')
112
+ # raises FileNotFoundError</code></pre>
113
+
114
+
115
+ <!-- bottom navigation -->
116
+
117
+ <div class="footer">
118
+ <a href="01_introduction.html">Previous</a> &bull;
119
+ <a href="index.html">Up</a> &bull;
120
+ <a href="03_fileurlclass.html">Next</a>
121
+ </div>
122
+
123
+ </body>
124
+ </html>
@@ -0,0 +1,126 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+
5
+ <title>rb-mactypes manual | 3. FileURL class</title>
6
+
7
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
8
+ <style type="text/css" media="all"><!--@import url(../full.css);--></style>
9
+
10
+ </head>
11
+ <body>
12
+
13
+ <h1><img src="../rb-appscript-logo.png" alt="rb-appscript" title="rb-appscript" /></h1>
14
+
15
+ <!-- top navigation -->
16
+ <div class="navbar">
17
+ <a href="02_aliasclass.html">Previous</a> &bull;
18
+ <a href="index.html">Up</a> &bull;
19
+ <a href="04_unitsclass.html">Next</a>
20
+
21
+ <span>
22
+ <a href="../appscript-manual/index.html">appscript</a> /
23
+ <strong><a href="../mactypes-manual/index.html">mactypes</a></strong> /
24
+ <a href="../osax-manual/index.html">osax</a> /
25
+ <a href="../aem-manual/index.html">aem</a>
26
+ </span>
27
+ </div>
28
+
29
+ <!-- content -->
30
+ <div id="content">
31
+
32
+
33
+ <h2>3. The <code>MacTypes::FileURL</code> class</h2>
34
+
35
+ <p>The <code>FileURL</code> class represents a fixed filesystem location. This may be deterministic (i.e. existing locations only) or non-deterministic depending on how the object is created.</p>
36
+
37
+ <h3>Methods</h3>
38
+
39
+ <pre><code>FileURL -- identifies a fixed filesystem location
40
+ Constructors:
41
+
42
+ FileURL.path(path) -- make FileURL object from POSIX path string
43
+
44
+ FileURL.hfs_path(path) -- make FileURL object from HFS path string
45
+
46
+ FileURL.url(url) -- make FileURL object from a local file:// URL string
47
+
48
+ FileURL.desc(desc) -- make FileURL object from an AE::AEDesc
49
+ of TypeFSS, TypeFSRef or TypeFileURL
50
+
51
+ Methods:
52
+
53
+ ==
54
+
55
+ hash
56
+
57
+ inspect
58
+
59
+ path -- returns POSIX path string
60
+
61
+ hfs_path -- returns HFS path string
62
+
63
+ url -- returns file:// URL string
64
+
65
+ desc -- returns AE::AEDesc of TypeFSRef, TypeFSS or TypeFileURL
66
+
67
+ to_s -- synonym for #path
68
+
69
+ to_alias -- returns a MacTypes::Alias object
70
+
71
+ to_file_url -- returns a new MacTypes::FileURL object</code></pre>
72
+
73
+
74
+ <h3>Examples</h3>
75
+
76
+ <pre><code>require "appscript"
77
+
78
+ f = MacTypes::FileURL.path('/Users/foo/new file')
79
+
80
+ puts f.to_s
81
+ # /Users/foo/new file
82
+
83
+ puts f.url
84
+ # file://localhost/Users/foo/some%20file
85
+
86
+ puts f.inspect
87
+ # MacTypes::FileURL.path("/Users/foo/new file")
88
+
89
+ Appscript.app('TextEdit').documents[1].save(:in => f)
90
+ # saves front TextEdit document at the given location</code></pre>
91
+
92
+
93
+ <h3>Notes</h3>
94
+
95
+ <p>Unlike the <code>Alias</code> class which wraps <code>TypeAlias</code> values only, the <code>FileURL</code> class provides a uniform wrapper for several file-related types that may be returned by applications: <code>TypeFSS</code>, <code>TypeFSRef</code> and <code>TypeFileURL</code>. When passing <code>FileURL</code> values to applications, you should not normally need to worry about which value type a <code>FileURL</code> object contains as well-designed applications will ask the Apple Event Manager to coerce the given value to the desired type as necessary.</p>
96
+
97
+ <p>When dealing with less well-behaved applications, however, you may need to pass an AEDesc of a specific type. In this case you should use the <code>desc</code> method to obtain an <code>AE::AEDesc</code> object, then call its <code>coerce</code> method to obtain an AEDesc of the desired type. For example, if an older Carbon application refuses to accept a FileURL identifying a non-existing file location, you may need to provide a FSSpec instead:</p>
98
+
99
+ <pre><code>require "appscript"
100
+
101
+ file_url = MacTypes::FileURL.path('/Users/foo/new file')
102
+
103
+ fs_spec = file_url.desc.coerce(KAE::TypeFSS)
104
+
105
+ Appscript.app('older app').documents[1].save(:in => fs_spec)</code></pre>
106
+
107
+ <p>When used in an application command, a <code>FileURL</code> object returned by appscript will always pack into the same <code>TypeFSRef</code>, <code>TypeFileURL</code> or <code>TypeFSS</code> AEDesc it was created from. A <code>FileURL</code> object returned by <code>FileURL.path</code>, <code>Alias#to_file_url</code> or <code>FileURL#to_file_url</code> will always pack into an AEDesc of <code>TypeFileURL</code>.</p>
108
+
109
+ <p>When comparing <code>FileURL</code> objects for equality, be aware that <code>FileURL#==</code> always performs case-sensitive comparisons, regardless of how the underlying filesystem handles case-[in]sensitivity.</p>
110
+
111
+ <p>Note that AEDescs of <code>TypeFSRef</code> can represent existing filesystem locations only. AEDescs of <code>TypeFileURL</code> can represent both existing and non-existing locations. AEDescs of <code>TypeFSS</code> (FSSpecs) are deprecated on Mac OS X due to lack of proper Unicode and long filename support, and are retained for backwards compatibility with older applications only.</p>
112
+
113
+ <p>Be aware that <code>FileURL#==</code> does not normalize file URLs; thus minor differences in capitalization, etc. can result in <code>FileURL#==</code> returning <code>false</code> even if both objects happen to identify the same filesystem location.</p>
114
+
115
+ </div>
116
+
117
+ <!-- bottom navigation -->
118
+
119
+ <div class="footer">
120
+ <a href="02_aliasclass.html">Previous</a> &bull;
121
+ <a href="index.html">Up</a> &bull;
122
+ <a href="04_unitsclass.html">Next</a>
123
+ </div>
124
+
125
+ </body>
126
+ </html>
@@ -0,0 +1,100 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+
5
+ <title>rb-mactypes manual | 4. Units class</title>
6
+
7
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
8
+ <style type="text/css" media="all"><!--@import url(../full.css);--></style>
9
+
10
+ </head>
11
+ <body>
12
+
13
+ <h1><img src="../rb-appscript-logo.png" alt="rb-appscript" title="rb-appscript" /></h1>
14
+
15
+ <!-- top navigation -->
16
+ <div class="navbar">
17
+ <a href="03_fileurlclass.html">Previous</a> &bull;
18
+ <a href="index.html">Up</a>
19
+
20
+ <span>
21
+ <a href="../appscript-manual/index.html">appscript</a> /
22
+ <strong><a href="../mactypes-manual/index.html">mactypes</a></strong> /
23
+ <a href="../osax-manual/index.html">osax</a> /
24
+ <a href="../aem-manual/index.html">aem</a>
25
+ </span>
26
+ </div>
27
+
28
+ <!-- content -->
29
+ <div id="content">
30
+
31
+ <h2>4. The <code>MacTypes::Units</code> class</h2>
32
+
33
+ <p>The <code>Units</code> class represents a measurement of some sort, e.g. 3 inches, 98.5 degrees Fahrenheit.</p>
34
+
35
+ <pre><code>class Units
36
+
37
+ Constructor:
38
+
39
+ Units.new(value, type)
40
+ value : Fixnum | Bignum | Float -- the amount, e.g. 3.5
41
+ type : Symbol -- the unit of measurement, e.g. :centimeters
42
+
43
+ Methods:
44
+
45
+ ==
46
+
47
+ hash
48
+
49
+ inspect
50
+
51
+ value -- returns the amount
52
+
53
+ type -- returns the unit of measurement
54
+
55
+ to_i -- returns the amount as an integer
56
+
57
+ to_f -- returns the amount as a float
58
+
59
+ to_s -- returns the measurement as a string, e.g. "3.5 centimeters"</code></pre>
60
+
61
+ <p>The following unit types are defined as standard:</p>
62
+
63
+ <pre><code>:centimeters :cubic_inches
64
+ :meters :cubic_feet
65
+ :kilometers :cubic_yards
66
+ :inches
67
+ :feet :liters
68
+ :yards :quarts
69
+ :miles :gallons
70
+
71
+ :square_meters :grams
72
+ :square_kilometers :kilograms
73
+ :square_feet :ounces
74
+ :square_yards :pounds
75
+ :square_miles
76
+ :degrees_Celsius
77
+ :cubic_centimeters :degrees_Fahrenheit
78
+ :cubic_meters :degrees_Kelvin</code></pre>
79
+
80
+ <p>Additional application-specific unit types can be added if needed.</p>
81
+
82
+
83
+ <h3>Examples</h3>
84
+
85
+ <pre><code>MacTypes::Units.new(14, :inches)
86
+
87
+ MacTypes::Units.new(3.5, :square_meters)</code></pre>
88
+
89
+
90
+ </div>
91
+
92
+ <!-- bottom navigation -->
93
+
94
+ <div class="footer">
95
+ <a href="03_fileurlclass.html">Previous</a> &bull;
96
+ <a href="index.html">Up</a>
97
+ </div>
98
+
99
+ </body>
100
+ </html>