-
Two weeks until the end of term
-
Next term Rails and the Rails project
- Best practices
- Testing
- Working with larger projects
- More on objects
- Databases
- MVC pattern
- Sinatra
- larger code bases
- splitting code into multiple files
- organising files
- recognising and implementing patterns
- processes
- more git practice
-
Lazy developer
-
ROI
- how much time on automation vs time on project
-
Rubocop
- Coding Style for Rails - best practices for methods lengths, examples
- Review a class and the various variable types and scope
- variable local to a method
- instance variable
- class variable
class Person
@@employee_number = 0
def initialize(name, job_title, phone, salary)
@name = name
@job_title = job_title
@phone = phone
@salary = salary
@@employee_number = @@employee_number + 1
@number = @@employee_number
end
# getters
def name
return @name
end
def job_title
return @job_title
end
def phone
return @phone
end
def salary
return @salary
end
def description
return "#{@name} is a #{job_title}"
end
end
kerry = Person.new("Kerry MacFarlane", "developer", "555-1234", "60000")
terry = Person.new("Terry Grayson", "manager", "555-3456", "70000")
sam = Person.new("Sam Ferguson", "developer", "555-4321", "65000")
puts kerry.description
puts terry.description
puts sam.description