class JobEngine::PositionCollection
Attributes
positions[R]
Public Class Methods
new(positions)
click to toggle source
# File lib/job_engine/position_collection.rb, line 12 def initialize(positions) @positions = positions end
Public Instance Methods
count()
click to toggle source
# File lib/job_engine/position_collection.rb, line 16 def count @positions.length end
featured()
click to toggle source
# File lib/job_engine/position_collection.rb, line 24 def featured wrap(@positions.select { |position| position.featured? }) end
reverse_chronological()
click to toggle source
# File lib/job_engine/position_collection.rb, line 20 def reverse_chronological wrap(@positions.sort_by { |position| position.updated_at }.reverse) end
Private Instance Methods
wrap(array)
click to toggle source
# File lib/job_engine/position_collection.rb, line 30 def wrap(array) self.class.new(array) end