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.



174
175
176
177
# File 'lib/less/loader.rb', line 174

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

Instance Attribute Details

#dataObject

faked because ServerResponse acutally implements WriteableStream



172
173
174
# File 'lib/less/loader.rb', line 172

def data
  @data
end

#statusCodeObject

Returns the value of attribute statusCode.



171
172
173
# File 'lib/less/loader.rb', line 171

def statusCode
  @statusCode
end

Instance Method Details

#on(event, callback) ⇒ Object



179
180
181
182
183
184
185
186
# File 'lib/less/loader.rb', line 179

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