Sha256: c4e593f594c7b018120da8ad7426f5ef9c54a82e581f9d0f1bfbd621710184bf

Contents?: true

Size: 815 Bytes

Versions: 1

Compression:

Stored size: 815 Bytes

Contents

require 'artoo/adaptors/adaptor'

module Artoo
  module Adaptors
    # Connect to a opencv device
    # @see device documentation for more information
    class Opencv < Adaptor
      finalizer :finalize
      attr_reader :device

      # Closes connection with device if connected
      # @return [Boolean]
      def finalize
        disconnect if connected?
      end

      # Creates a connection with device
      # @return [Boolean]
      def connect
        super
      end

      # Closes connection with device
      # @return [Boolean]
      def disconnect
        super
      end

      # Uses method missing to call device actions
      # @see device documentation
      def method_missing(method_name, *arguments, &block)
        device.send(method_name, *arguments, &block)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
artoo-opencv-0.0.1 lib/artoo/adaptors/opencv.rb