It time to start our final project. Before we do, let's go over a few things shall we....
Before you start you will need to supply the following to John and myself via email:
- Team Members
- Project Description
| require_relative 'jsonable' | |
| require 'pry-byebug' | |
| class Party | |
| def self.throw_party(number_of_candles) | |
| 'We are partying' | |
| true | |
| end | |
| end |
Today we are going to look at some interesting features of the javascript language. Javascript is a prototype-based language with 1st class functions derived from scheme (and self) languages with a C like syntax.
What is a prototype-based language? It is a language of object-oriented programming in which behaviour (think inheritance) is performed by cloning existing objects (i.e. prototypes). It is also an
| def fizzbuzz(start, final) | |
| start.upto(final) do |i| | |
| puts fizzbrain(i) | |
| end | |
| end | |
| def fizzbrain(num) | |
| output = '' | |
| output << 'Fizz' if num % 3 == 0 | |
| output << 'Buzz' if num % 5 == 0 |
| # Brewery related Functions | |
| def create_beer(brewery, name, style, abv) | |
| beer = {name: name, style: style, abv: abv, quantity: 0} | |
| brewery[:beers] << beer | |
| end | |
| def print_brewery(brewery) | |
| puts "\n" | |
| puts "#{brewery[:name]}" |
| var API_KEY = "MDphMmIxNDY0Mi0zYjYwLTExZTUtYTRlOS1hZjBkOWE1YzRmYzI6WWRZR1h6Q0ZwQk9JNG00YTJMcHBsOFNxcUxjeklpTmVEWGlz"; | |
| var beerTemplate = _.template($('#beer-template').html()); | |
| function getBeerList(name) { | |
| $.ajax({ | |
| url: 'https://lcboapi.com/products', | |
| data: {q: name}, | |
| method: 'GET', | |
| headers: { 'Authorization': "TOKEN " + API_KEY } |
| <div id="container"> | |
| <img src="http://i.imgur.com/ls5qG.jpg"> | |
| </div> |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css"> | |
| <link rel="stylesheet" href="main.css"> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
| <script src="main.js"></script> | |
| </head> |