Here is a quick set of ruby code to give an overview of ruby things
Things that should be covered as part of this
- Comments
- Strings
- Different types (", ', and symbols)
- Manipulating them
- Creating a class
- Naming
- Variable types (instance, class, constants)
- methods, special characters, params and default values
- returning values
- helper methods
- Including other code
- Errors
- http://apidock.com/ruby
- http://apidock.com/rails
- http://www.codeschool.com
- https://github.com/bbatsov/ruby-style-guide
- All code written will be done in
person.rb - The class you create in the code will be called
Person
Run the following command to see the available tasks
$ rake -T
rake test # Run tests
rake test_example # Run test example code
Simply run the following command to test your code
rake
A successful run should output
Run options:
# Running tests:
...............
Finished tests in 0.001549s, 9683.6669 tests/s, 12265.9781 assertions/s.
15 tests, 19 assertions, 0 failures, 0 errors, 0 skips