Sha256: 5888ba360558c5a328d3e214bd25f86eb19f8d38426975fa0fc4d764980afb7c

Contents?: true

Size: 762 Bytes

Versions: 1

Compression:

Stored size: 762 Bytes

Contents

module Matplotlib
  class Axes3D
    include PyCall::PyObjectWrapper

    @__pyobj__ = PyCall.import_module('matplotlib.axes').Axes

    PyCall.dir(@__pyobj__).each do |name|
      obj = PyCall.getattr(@__pyobj__, name)
      next unless obj.kind_of?(PyCall::PyObject) || obj.kind_of?(PyCall::PyObjectWrapper)
      next unless PyCall.callable?(obj)

      define_method(name) do |*args, **kwargs|
        PyCall.getattr(__pyobj__, name).(*args, **kwargs)
      end
    end

    class << self
      attr_reader :__pyobj__

      def method_missing(name, *args, **kwargs)
        return super unless PyCall.hasattr?(__pyobj__, name)
        PyCall.getattr(__pyobj__, name)
      end
    end

    PyCall::Conversions.python_type_mapping(__pyobj__, self)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
matplotlib-0.1.0.alpha.20170302 lib/matplotlib/axes.rb