Module: Graffle::Document
- Includes:
- Builders
- Defined in:
- lib/graffle/stereotypes.rb
Overview
An entire Graffle file, parsed. The only thing of interest is an array of objects stereotyped as Sheet. A Sheet is the internal name for what the OmniGraffle Pro GUI calls “canvases.”
OmniGraffle non-Pro can only produce one-canvas documents.
Some one-canvas OmniGraffle documents don’t actually have Sheets. So that you don’t have to worry about that, a one-element Sheet array is inserted if needed.
Class Method Summary collapse
-
.takes_on(hash) ⇒ Object
:nodoc:.
Instance Method Summary collapse
- #first_sheet ⇒ Object
-
#make_sure_has_sheets ⇒ Object
If this is a graffle document with an implicit single sheet, make it explicit.
- #sheets ⇒ Object
-
#with(*objects) ⇒ Object
:nodoc:.
Methods included from Builders
#abstract_graphic, #annotation, classed, #document, #group, #line_graphic, #line_label, raw, #shaped_graphic, #sheet, #text
Class Method Details
Instance Method Details
#first_sheet ⇒ Object
164 |
# File 'lib/graffle/stereotypes.rb', line 164 def first_sheet; sheets[0]; end |
#make_sure_has_sheets ⇒ Object
If this is a graffle document with an implicit single sheet, make it explicit. MISSING: This destroys the structure of the file, so it should not now be written.
188 189 190 191 |
# File 'lib/graffle/stereotypes.rb', line 188 def make_sure_has_sheets # :nodoc: splice_in_single_sheet unless self.has_key?('Sheets') self end |
#sheets ⇒ Object
163 |
# File 'lib/graffle/stereotypes.rb', line 163 def sheets; self['Sheets']; end |
#with(*objects) ⇒ Object
:nodoc:
167 168 169 170 171 172 |
# File 'lib/graffle/stereotypes.rb', line 167 def with(*objects) # :nodoc: self['Sheets'] = [] unless self.has_key?('Sheets') objects.each do | o | self['Sheets'] << o end end |