Skip to content

Instantly share code, notes, and snippets.

Mihai Banulescu bluemihai

Block or report user

Report or block bluemihai

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View house_oop_example.rb
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
View weird-attr-issue.rb
class Cell
attr_accessor :options
def initialize(position, value)
self.options = (1..9).to_a
end
# def options
# puts "running .options with @options #{}"
# @options
View real-world-oop-challenge.md

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 Aug 29, 2015
My Portfolio
View MyPortfolio
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:
You can’t perform that action at this time.