This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| array = [['Number', 'Name'], [1, 'Foo'], [2, 'Bar'], [3, 'Baz']] | |
| pretty_table(array) | |
| # printed result: | |
| +--------+--------+ | |
| | Number | Name | | |
| +--------+--------+ | |
| | 1 | Foo | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
NewerOlder