Class: AAlib::SaveData
- Inherits:
-
CPtr
- Object
- DL::PtrData
- CPtr
- AAlib::SaveData
- Defined in:
- lib/aalib.rb
Overview
Encapsulation of data required to save a file to disk.
Constant Summary collapse
- TYPE =
:nodoc:
'SPP'
- NAMES =
:nodoc:
[:name, :format, :file]
Instance Method Summary collapse
-
#format ⇒ Object
Returns the AAlib::SaveFormat that will be used for saving.
-
#initialize(name, format, formatflags = 0) ⇒ SaveData
constructor
Initializes a new SaveData to save to file name with SaveFormat format.
-
#name ⇒ Object
Returns the file name that will be used for saving.
Methods inherited from CPtr
Methods included from ArgumentChecks
Methods inherited from DL::PtrData
Constructor Details
#initialize(name, format, formatflags = 0) ⇒ SaveData
Initializes a new SaveData to save to file name with SaveFormat format. Passing a string format uses the format returned by AAlib::SaveFormat.find. See AAlib::SaveFormat for options set with flags; multiple flags should be logically OR’ed.
The AA-lib docs claim that file extensions are added automatically, but this appears to be false.
1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 |
# File 'lib/aalib.rb', line 1069 def initialize(name, format, formatflags=0) super() self.name = name if format.kind_of? AAlib::SaveFormat self.format = format else self.format = AAlib::SaveFormat.find(format) end self.format.flags = formatflags end |
Instance Method Details
#format ⇒ Object
Returns the AAlib::SaveFormat that will be used for saving
1084 1085 1086 |
# File 'lib/aalib.rb', line 1084 def format SaveFormat.new(self[:format]) end |
#name ⇒ Object
Returns the file name that will be used for saving.
1057 |
# File 'lib/aalib.rb', line 1057 def name; end |