所以我想将一个方法委托给一个单独的类,并为gem提供以下主文件:
def record(self):
for i in range(100000000):
t="allllaaaa"
self.textEdit.setPlaceholderText("waiting ... ")
def threadRecord(self):
self.textEdit.setPlaceholderText("speak now ")
thread = Thread(target = self.record)
thread.start()
thread.join()
require "content/version"
require "content/models/item"
require "content/models/category"
require "content/transformer"
require "content/service"
require "content/presenter"
require 'active_support/core_ext/module/delegation'
module Content
extend self
extend Forwardable
def_delegator :Item, :find, :find
def_delegator :Item, :find_multiple, :find_multiple
def_delegator :Category, :find, :find_category
end
定义如下:
require "content/models/item"
关于我哪里出错的任何想法?