Sha256: 5a0a11de4845f0390b7712967977d6bef08d8787ecf53f4092b13415a8fd2c80

Contents?: true

Size: 766 Bytes

Versions: 6

Compression:

Stored size: 766 Bytes

Contents

module Matplotlib
  class Figure
    include PyCall::PyObjectWrapper

    @__pyobj__ = PyCall.import_module('matplotlib.figure').Figure

    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

6 entries across 6 versions & 1 rubygems

Version Path
matplotlib-0.1.0.alpha.20170426 lib/matplotlib/figure.rb
matplotlib-0.1.0.alpha.20170419a lib/matplotlib/figure.rb
matplotlib-0.1.0.alpha.20170311 lib/matplotlib/figure.rb
matplotlib-0.1.0.alpha.20170309 lib/matplotlib/figure.rb
matplotlib-0.1.0.alpha.20170307 lib/matplotlib/figure.rb
matplotlib-0.1.0.alpha.20170302 lib/matplotlib/figure.rb