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
| chosen_names = [] | |
| fav_cat_names.each do |name| | |
| break if name == "Johnny Cochran" | |
| chosen_names << name | |
| end | |
| chosen_names |
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
| fav_cat_names.map do |name| | |
| break if name == "Johnny Cochran" | |
| name | |
| end |
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
| def test(cat) | |
| cat.map(&:name) | |
| end |
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
| #-sinatra server | |
| # -spotify module | |
| # -spotify gem | |
| # -attributes and methods: search, play | |
| # -playlister object | |
| # -include/extend spotify module | |
| # -creates song objects from the spotify search data | |
| # -methods: sort, list, |
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
| def initialize(attributes) | |
| attributes.each do |attribute, value| | |
| self.class.send(:define_method, attribute) do | |
| @attribute = value | |
| end | |
| end | |
| end | |
| end |
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 Integer | |
| @@roman_numerals = { | |
| 1000 => "M", | |
| 900 => "CM", | |
| 500 => "D", | |
| 400 => "CD", | |
| 100 => "C", | |
| 90 => "XC", | |
| 50 => "L", | |
| 40 => "XL", |
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
| def is_a_vowel?(v) | |
| 'aeiou'.include?(v) | |
| end |
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 TriangleError < Exception | |
| end | |
| class Triangle | |
| attr_reader :side1, :side2, :side3 | |
| def initialize(side1, side2, side3) | |
| @side1 = side1 | |
| @side2 = side2 | |
| @side3 = side3 |
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 School | |
| attr_reader :roster,:school | |
| def initialize(school) | |
| @school = school | |
| @roster = {} | |
| end | |
| def roster | |
| @roster |
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 Jukebox | |
| attr_accessor :songs | |
| DefaultSongs = [ | |
| "The Phoenix - 1901", | |
| "Tokyo Police Club - Wait Up", | |
| "Sufjan Stevens - Too Much", | |
| "The Naked and the Famous - Young Blood", | |
| "(Far From) Home - Tiga", | |
| "The Cults - Abducted", |