amqp-dsl
Version:
Amqp-DSL - Fluent interface for node-amqp
26 lines (19 loc) • 419 B
text/coffeescript
# Helper class for rapid access (create/append/read only)
module.exports = class IndexedList
constructor:() ->
= {}
= []
get: ( key ) ->
[key] or false
set: ( key, value ) ->
.push(value)
[key] = value
null
length: ->
.length
last:() ->
[.length-1] or false
index:() ->
list:() ->