Skip to content

Instantly share code, notes, and snippets.

View baisa's full-sized avatar

Barbara Slawinska baisa

View GitHub Profile
array = [['Number', 'Name'], [1, 'Foo'], [2, 'Bar'], [3, 'Baz']]
pretty_table(array)
# printed result:
+--------+--------+
| Number | Name |
+--------+--------+
| 1 | Foo |
class Temperature
def initialize (tempratures_hash)
@tempratures = tempratures_hash
end
def in_fahrenheit
puts @temperatures
@tempratures.key(:f) ? @tempratures[:f] : (@tempratures[:c] * 9.0 / 5) + 32