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.



17
18
19
# File 'lib/async_partial.rb', line 17

def initialize(thread)
  @thread = thread
end

Instance Method Details

#html_safe?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/async_partial.rb', line 25

def html_safe?
  true
end

#nil?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/async_partial.rb', line 21

def nil?
  false
end

#to_sObject



29
30
31
# File 'lib/async_partial.rb', line 29

def to_s
  self
end

#valueObject



33
34
35
36
37
# File 'lib/async_partial.rb', line 33

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