Class: AAlib::SaveFormat
- Inherits:
-
CPtr
- Object
- DL::PtrData
- CPtr
- AAlib::SaveFormat
- Defined in:
- lib/aalib.rb
Overview
Output format used by AAlib.save
Constant Summary collapse
- TYPE =
:nodoc:
'IIIIIIPSS'
- NAMES =
[:width, :height, :pagewidth, :pageheight, :flags, :supported, :font, :formatname, :extension]
- USE_PAGES =
Flag to enable multiple pages
1
- NORMAL_SPACES =
Flag to use normal spaces (?)
8
Class Method Summary collapse
-
.find(pattern) ⇒ Object
Searches available save formats and returns the first that includes pattern, a Regexp or String.
Instance Method Summary collapse
-
#extension ⇒ Object
Returns the file extension including the dot.
-
#formatname ⇒ Object
Returns the name of the format.
Methods inherited from CPtr
#[], #[]=, #initialize, #inspect, new_ptr
Methods included from ArgumentChecks
Methods inherited from DL::PtrData
Constructor Details
This class inherits a constructor from AAlib::CPtr
Class Method Details
.find(pattern) ⇒ Object
Searches available save formats and returns the first that includes pattern, a Regexp or String. Raises exception if none found.
1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 |
# File 'lib/aalib.rb', line 1034 def find(pattern) if pattern.kind_of? Regexp regexp = pattern else regexp = /#{pattern}/i end AAlib.formats.each do |format| return format if format.formatname =~ regexp end raise AAlib::Error.new("Could not find output format matching #{pattern}") end |
Instance Method Details
#extension ⇒ Object
Returns the file extension including the dot.
1024 |
# File 'lib/aalib.rb', line 1024 def extension; end |
#formatname ⇒ Object
Returns the name of the format
1021 |
# File 'lib/aalib.rb', line 1021 def formatname; end |