Skip to content

Instantly share code, notes, and snippets.

View TrevMcKendrick's full-sized avatar

Trevor McKendrick TrevMcKendrick

View GitHub Profile
require 'pry'
class Integer
Roman_hash = {
1 => "I",
5 => "V",
10 => "X",
50 => "L",
100 => "C",
#attr_name = "attributes"
class Person
def initialize(attr_name)
Person.class_eval {class << self; self end}.send(:attr_accessor,attr_name)
end
end
require 'sqlite3'
require 'pry'
class Dog
attr_accessor :name, :color, :id
@@db = SQLite3::Database.new 'dogs.db'
def self.find(id)
find = "SELECT * FROM dogs WHERE id = ?"
class School
attr_accessor :name, :roster
def initialize(name)
@roster = {}
@name = name
end
def add_student(student_name, grade)
class Triangle
attr_accessor :side_a, :side_b, :side_c
def initialize(side_a, side_b, side_c)
@side_a = side_a
@side_b = side_b
@side_c = side_c
puts 2
end
class School
attr_accessor :name, :roster
def initialize(name)
@roster = {}
@name = name
end
def add_student(student_name, grade)
require 'simplecov'
SimpleCov.start
require 'json'
require 'rspec'
require_relative 'jukebox'
require_relative 'song'
RSpec.configure do |config|
# Use color in STDOUT
class Jukebox
attr_accessor :songs, :desire, :current_song #:song_hash
def initialize(songs)
@songs = songs
#@song_hash = {}
help
end
class StudentScraper
attr_accessor :main_index_url
def initialize(main_index_url)
@main_index_url = main_index_url
end
def call
require 'nokogiri'
require 'open-uri'
require_relative './student_scraper'
require_relative './student'
require_relative './CLIstudent.rb'
require 'pry'
main_index_url = "http://students.flatironschool.com"
student_scrape = StudentScraper.new(main_index_url)
student_array = student_scrape.c2
student_array.each do |student_hash|