Method: Ruber::KTextEditorWrapper::InterfaceProxy#interface=
- Defined in:
- lib/ruber/editor/ktexteditor_wrapper.rb
permalink #interface=(iface) ⇒ Object
Sets the interface to which the object is going to be cast. iface can be either the name of an interface, as symbol or string, both in camelcase or snakecase (withouth the KTextEditor
namespace) or the class itself. After a call to this method (and until the next one) method_missing
will redirect all unknown method calls to this interface.
65 66 67 68 69 70 71 72 |
# File 'lib/ruber/editor/ktexteditor_wrapper.rb', line 65 def interface= iface cls = if iface.is_a? Class then iface else name = iface.to_s.split('_').map(&:capitalize).join '' KTextEditor.const_get(name) end @interface = @obj.qobject_cast cls end |