Class: Isono::Rack::Response

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

Direct Known Subclasses

Job::JobResponse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ctx) ⇒ Response

Returns a new instance of Response.

Parameters:

Raises:

  • (TypeError)


48
49
50
51
# File 'lib/isono/rack.rb', line 48

def initialize(ctx)
  raise TypeError unless ctx.is_a?(NodeModules::RpcChannel::ResponseContext)
  @ctx = ctx
end

Instance Attribute Details

#ctxObject (readonly)

Returns the value of attribute ctx.



45
46
47
# File 'lib/isono/rack.rb', line 45

def ctx
  @ctx
end

Instance Method Details

#progress(msg) ⇒ Object



57
58
59
# File 'lib/isono/rack.rb', line 57

def progress(msg)
  @ctx.progress(msg)
end

#responded?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/isono/rack.rb', line 53

def responded?
  @ctx.responded?
end

#response(msg) ⇒ Object



61
62
63
# File 'lib/isono/rack.rb', line 61

def response(msg)
  @ctx.response(msg)
end