Class: AsyncPartial::AsyncResult

Inherits:
Object
  • Object
show all
Defined in:
lib/async_partial.rb

Instance Method Summary collapse

Constructor Details

#initialize(thread) ⇒ AsyncResult

Returns a new instance of AsyncResult.



38
39
40
# File 'lib/async_partial.rb', line 38

def initialize(thread)
  @thread = thread
end

Instance Method Details

#html_safe?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/async_partial.rb', line 46

def html_safe?
  true
end

#nil?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/async_partial.rb', line 42

def nil?
  false
end

#to_sObject



50
51
52
# File 'lib/async_partial.rb', line 50

def to_s
  self
end

#valueObject



54
55
56
57
58
# File 'lib/async_partial.rb', line 54

def value
  val = @thread.value
  @thread.kill
  val
end