Class: Ohm::Model::List

Inherits:
Collection show all
Defined in:
lib/ohm.rb

Constant Summary

Raw =
Ohm::List

Instance Method Summary (collapse)

Methods inherited from Collection

#<<, #[], #all, #clear, #concat, #delete, #each, #empty?, #first, #include?, #initialize, #key, #replace, #size, #sort, #sort_by

Constructor Details

This class inherits a constructor from Ohm::Model::Collection

Instance Method Details

- (Object) inspect



267
268
269
# File 'lib/ohm.rb', line 267

def inspect
  "#<List (#{model}): #{all.inspect}>"
end

- (Object) pop



257
258
259
260
261
# File 'lib/ohm.rb', line 257

def pop
  if id = raw.pop
    model[id]
  end
end

- (Object) shift



251
252
253
254
255
# File 'lib/ohm.rb', line 251

def shift
  if id = raw.shift
    model[id]
  end
end

- (Object) unshift(model)



263
264
265
# File 'lib/ohm.rb', line 263

def unshift(model)
  raw.unshift(model.id)
end