Class: Less::Loader::Http::ServerResponse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, status_code) ⇒ ServerResponse

Returns a new instance of ServerResponse.



215
216
217
218
# File 'lib/less/loader.rb', line 215

def initialize(data, status_code)
  @data = data
  @statusCode = status_code
end

Instance Attribute Details

#dataObject

faked because ServerResponse acutally implements WriteableStream



213
214
215
# File 'lib/less/loader.rb', line 213

def data
  @data
end

#statusCodeObject

Returns the value of attribute statusCode.



212
213
214
# File 'lib/less/loader.rb', line 212

def statusCode
  @statusCode
end

Instance Method Details

#on(event, callback) ⇒ Object



220
221
222
223
224
225
226
227
# File 'lib/less/loader.rb', line 220

def on(event, callback)
  case event
  when 'data'
    callback.call(@data)
  else
    callback.call()
  end
end