- Download this application skeleton.
- Convert the app to use AJAX.
- Add any files you changed to your gist and submit your code.
This file contains 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 Company | |
attr_accessor :company_name | |
attr_reader :employees | |
def initialize(name) | |
@company_name = name | |
@employees = [] | |
end | |
This file contains 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 Person | |
def self.example_class_method | |
puts "We're calling an example class method" | |
puts "'self' is always defined. What is 'self' here? Let's see." | |
p self | |
puts "That was self!" | |
end | |
def example_instance_method | |
puts "We're calling an example *instance* method" |
This file contains 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
# Solution for Challenge: Ruby Drill: Exploring Scope. Started 2013-08-12T19:15:43+00:00 | |
local_var = 2 | |
THIS_IS_A_CONSTANT = 600 | |
$global_var = 500 | |
# def get_local_var | |
# local_var |
This file contains 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
# Solution for Challenge: Design Drill: Public vs. Private Interfaces. Started 2013-08-12T16:17:53+00:00 | |
class BankAccount | |
attr_reader :customer_name, :type, :acct_number | |
attr_writer :customer_name | |
def initialize (customer_name, type, acct_number) | |
@customer_name = customer_name | |
@type = type |
This file contains 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
# This is how you define your own custom exception classes | |
class NoOrangesError < StandardError | |
end | |
class OrangeTree | |
attr_reader :height, :age | |
def initialize (height, age) | |
@height = height | |
@age = age |
This file contains 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 Question | |
attr_reader :question, :answer | |
def initialize(args) | |
@question = args[0] | |
@answer = args[1] | |
end | |
def to_s | |
"#{question} - #{answer}" |

- Download this application skeleton.
- Convert the app to use AJAX.
- Add any files you changed to your gist and submit your code.
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css"> | |
<link rel="stylesheet" href="main.css"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900"> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css"> | |
</head> |
OlderNewer