Class: AAlib::SaveFormat

Inherits:
CPtr show all
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

Instance Method Summary collapse

Methods inherited from CPtr

#[], #[]=, #initialize, #inspect, new_ptr

Methods included from ArgumentChecks

included

Methods inherited from DL::PtrData

#string?

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.

Raises:



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

#extensionObject

Returns the file extension including the dot.



1024
# File 'lib/aalib.rb', line 1024

def extension; end

#formatnameObject

Returns the name of the format



1021
# File 'lib/aalib.rb', line 1021

def formatname; end