Skip to content

Instantly share code, notes, and snippets.

View bluemihai's full-sized avatar

Mihai Banulescu bluemihai

View GitHub Profile
class House
attr_accessor :rooms, :furnished, :residents, :address, :price
def initialize(args={})
@rooms = args.fetch(:rooms, [])
@furnished = args.fetch(:furnished, true)
# THIS FAILS! REASON TO USE .fetch
# @furnished = args[:furnished] || true
end
class Cell
attr_accessor :options
def initialize(position, value)
self.options = (1..9).to_a
end
# def options
# puts "running .options with @options #{}"
# @options

Release 0

Pick two real-life objects that have some relationship, i.e. a reason to send messages to each other. Define a class for each. Initialize it with data that makes sense, and have at least one other method for each.

Have some runner code that creates one (or more) objects in that class, and tries those methods.

This should take you no longer than 15 minutes.

@bluemihai
bluemihai / MyPortfolio
Last active August 29, 2015 13:56
My Portfolio
This is a quick way for me to share my code with prospective employers.
Python
https://github.com/bluemihai/data-manipulation (CODING CHALLENGE)
https://github.com/bluemihai/chess-games (PERSONAL PROJECT)
https://github.com/bluemihai/python-wiki-cloud (CODING CHALLENGE)
https://github.com/bluemihai/my-codility-solutions (TEST SITE)
https://github.com/bluemihai/my-coderbyte-solutions (TEST SITE)
Ruby on Rails: