I hereby claim:
- I am ciprianna on github.
- I am ciprianna (https://keybase.io/ciprianna) on keybase.
- I have a public key ASDsxpwL81PFvFAey6pQ66CDOEFAE_jKvw31LSoqRgnGDAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
<head><center><h1>Add a New Shoe</h1></center></head> | |
<body> | |
<center> | |
<form action="/save_new_shoe"> | |
<p>Product name | |
<input type="text" name="name" placeholder="Product Name"></p> | |
<p>Cost | |
<input type="number" name="cost" placeholder="Cost"></p> | |
<p>Color | |
<input type="text" name="color" placeholder="Color"></p> |
# Driver | |
require "sqlite3" | |
require_relative "menu_module.rb" | |
require_relative "validity_module.rb" | |
require_relative "database_class_methods.rb" | |
require_relative "database_instance_methods.rb" | |
require_relative "shoes.rb" | |
require_relative "location.rb" | |
require_relative "category.rb" |
# Driver | |
require "sqlite3" | |
require_relative "shoes.rb" | |
require_relative "location.rb" | |
require_relative "category.rb" | |
# Creates the database connection | |
DATABASE = SQLite3::Database.new("shoe_inventory.db") |
# Check Splitter Info | |
# Check Splitter | |
# Creates new class called CheckSplitter | |
class CheckSplitter | |
# Shows which attributes are accessible | |
attr_accessor :total_cost, :tip_percentage, :people, :args |
# Resource Class | |
require "sqlite3" | |
# Creates the database connection | |
DATABASE = SQLite3::Database.new("pets.db") | |
# Creates the table | |
# DATABASE.execute("CREATE TABLE cats (id INTEGER PRIMARY KEY, name TEXT, age INTEGER);") |
# Dinner Club | |
require './club_event.rb' | |
class DinnerClub | |
attr_accessor :running_balance, :club_history | |
# Creates an empty hash to store the dinner club members and their balance. | |
# Makes the default value of the hash 0, so that new members can be added. |
Ruby Gems and APIs are both useful for expanding capabilities of a given program.
A Ruby Gem is a piece of code or files that a user has packaged for distribution and use for all other Ruby users. It serves a specific purpose (or related group of purposes) and is written by Ruby users. It can be continually updated and collaborated on. Gems are available on a public hub (Ruby Gems) for all Ruby users.
APIs are raw code output. They're the pure data without any wrapping/formatting of any kind. Programs build user interfaces on the APIs to make them user-friendly. This can be done using a gem, if someone has created a gem for this purpose. Gems don't require authentication or access, while APIs do, because APIs are often producing large amounts of data that's being used to run/build a program.
require "active_support" | |
require "active_support/core_ext/String/filters.rb" | |
puts "What paragraph would you like to truncate?" | |
paragraph = gets.chomp | |
puts "How many characters would you like to have?" | |
character_length = gets.to_i | |
puts paragraph.truncate(character_length) |
# Rock Paper Scissors | |
require './game.rb' | |
# This section gets inputs from the user and stores them as player1 and player2. | |
puts "Let's play Rock-Paper-Scissors." | |
puts "\n" | |
puts "Who's player 1?" | |
name_one = gets.chomp.capitalize | |
puts "And who is #{name_one} playing against? Or type 'computer' if you'd like to play against the machine." |