Class: Resume::Job

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

Overview

A job that you had, i.e. a time working for a company

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeJob

Returns a new instance of Job.



297
298
299
# File 'lib/resume.rb', line 297

def initialize
    @positions = Array.new
end

Instance Attribute Details

#date_rangeObject

Returns the value of attribute date_range.



291
292
293
# File 'lib/resume.rb', line 291

def date_range
  @date_range
end

#locationObject

Location, e.g. San Francisco, VA



293
294
295
# File 'lib/resume.rb', line 293

def location
  @location
end

#nameObject

Name of the company



290
291
292
# File 'lib/resume.rb', line 290

def name
  @name
end

#positionsObject

Array of Position objects



295
296
297
# File 'lib/resume.rb', line 295

def positions
  @positions
end

Class Method Details

.scaffold(name = "Initech") ⇒ Object



301
302
303
304
305
306
307
308
309
# File 'lib/resume.rb', line 301

def Job.scaffold(name="Initech")
    job = Job.new
    job.name = name
    job.date_range = DateRange.scaffold(2000,2003)
    job.location = "San Francisco, CA"
    job.positions << Position.scaffold("Lead Copy Boy",2001)
    job.positions << Position.scaffold("Copy Boy",2000)
    job
end

Instance Method Details

#<=>(other_position) ⇒ Object



311
312
313
314
315
# File 'lib/resume.rb', line 311

def <=>(other_position)
    return 1 if !other_position
    return 1 if !other_position.date_range
    return date_range <=> other_position.date_range
end