Spis treści:
- Czas i miejsce
- Uczestnicy
- O Wybuchu
- Koncepcja gry
- TODO
module ShowMyMethods | |
def self.included(base) | |
puts (base.instance_methods - Object.instance_methods).sort | |
end | |
end | |
class IncludeFirst | |
include ShowMyMethods | |
def it_wont_be_shown; end |
json.set! :files do | |
json.array! [@car_photo] do |photo| | |
json.id car_photo.id | |
json.url car_photo.car_photo.url(:thumb) | |
end | |
end |
require 'rspec' | |
class MoneyChanger | |
def initialize(notes=[200,100,50,20,10,5,2,1]) | |
@notes = notes.uniq.sort.reverse | |
end | |
def change(amount) | |
possible_notes = @notes.select {|n| n <= amount} |
roman = %w(M CM D CD C XC L XL X IX V IV I) | |
arabic = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1] | |
@roman_arabic = Hash[*roman.zip(arabic).flatten] | |
def arabic2roman(arabic) | |
roman = "" | |
@roman_arabic.each do |symbol,value| | |
while arabic/value > 0 | |
roman << symbol | |
arabic -= value |