class Plugin::GUI::Fragment

Attributes

model[R]

Public Class Methods

new(*args) click to toggle source
Calls superclass method Plugin::GUI::TabLike.new
# File core/plugin/gui/fragment.rb, line 24
def initialize(*args)
  super
  Plugin.call(:fragment_created, self)
end

Public Instance Methods

model_complete() { |model| ... } click to toggle source

完全なユーザ情報が取得できたらコールバックする

# File core/plugin/gui/fragment.rb, line 35
def model_complete(&callback)
  type_strict model => Diva::Model, callback => Proc
  if model[:exact]
    yield model
  else
    atomic {
      if not(defined?(@model_promise) and @model_promise)
        @model_promise = Service.primary.user_show(user_id: model[:id]).next{ |u|
          @model_promise = false
          u }.terminate{
          Plugin[:gui]._("%{user} のユーザ情報が取得できませんでした") % {user: model[:idname]}
        } end
      @model_promise = @model_promise.next{ |u| callback.call(u); u } } end
end
Also aliased as: retriever_complete
retriever() click to toggle source
# File core/plugin/gui/fragment.rb, line 29
def retriever; model end
retriever_complete(&callback)
Alias for: model_complete
user() click to toggle source
# File core/plugin/gui/fragment.rb, line 30
def user; model end