Module: Ccharts

Defined in:
lib/ccharts.rb,
lib/ccharts/ffi.rb,
lib/ccharts/chart.rb,
lib/ccharts/color.rb,
lib/ccharts/version.rb,
lib/ccharts/settings.rb

Defined Under Namespace

Modules: Color, FFI, Settings Classes: Chart, Error

Constant Summary collapse

VERSION =

Version of the Ruby gem, kept in lock-step with the C library's CCHARTS_VERSION (enforced by scripts/check_versions.py).

"3.0.0"

Class Method Summary collapse

Class Method Details

.max_cellsObject



47
48
49
# File 'lib/ccharts.rb', line 47

def self.max_cells
  FFI::MAX_CELLS.call
end

.max_dimObject

CC_MAX_DIM / CC_MAX_CELLS limits exposed by the ABI.



43
44
45
# File 'lib/ccharts.rb', line 43

def self.max_dim
  FFI::MAX_DIM.call
end

.raise_on(status) ⇒ Object

Raise if status is not CCHARTS_OK.



32
33
34
35
# File 'lib/ccharts.rb', line 32

def self.raise_on(status)
  return if status == 0
  raise Error.for_status(status)
end

.versionObject

Version of the underlying C library.



38
39
40
# File 'lib/ccharts.rb', line 38

def self.version
  FFI.read_cstr(FFI::VERSION.call)
end