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
[ | |
[0] { | |
"CHEESE" => { | |
:price => 6.5, | |
:clearance => false, | |
:count => 1 | |
} | |
}, | |
[1] { | |
"AVOCADO" => { |
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
ITEMS = [ {"AVOCADO" => {:price => 3.00, :clearance => true}}, | |
{"KALE" => {:price => 3.00,:clearance => false}}, | |
{"BLACK_BEANS" => {:price => 2.50,:clearance => false}}, | |
{"ALMONDS" => {:price => 9.00, :clearance => false}}, | |
{"TEMPEH" => {:price => 3.00,:clearance => true}}, | |
{"CHEESE" => {:price => 6.50,:clearance => false}}, | |
{"BEER" => {:price => 13.00, :clearance => false}}, | |
{"PEANUTBUTTER" => {:price => 3.00,:clearance => true}}, | |
{"BEETS" => {:price => 2.50,:clearance => false}}] |
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 Cylon | |
def initialize(parts) | |
@CPU = parts[:cpu] | |
@mcp_chip = parts[:MCP] | |
end | |
def thing_all_cylons_can_do | |
# hate humans or something. | |
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 Cylon | |
def initialize(parts) | |
@CPU = parts[:cpu] | |
@mcp_chip = parts[:MCP] | |
@cool_new_centurion_part = parts[:cool_new_centurion_part] | |
end | |
def some_cylon_action | |
# I don't know, lifting trucks in the air or something. | |
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 Cylon | |
def initialize(parts) | |
@CPU = parts[:cpu] | |
@mcp_chip = parts[:MCP] | |
@cool_new_centurion_part = parts[:cool_new_centurion_part] | |
end | |
def some_cylon_action | |
# I don't know, lifting trucks in the air or something. | |
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 Cylon | |
def initialize(parts) | |
@CPU = parts[:cpu] | |
@mcp_chip = parts[:MCP] | |
end | |
def some_cylon_action | |
# I don't know, lifting trucks in the air or something. | |
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
require 'awesome_print' | |
ITEMS = [ {"AVOCADO" => {:price => 3.00, :clearance => true}}, | |
{"KALE" => {:price => 3.00,:clearance => false}}, | |
{"BLACK_BEANS" => {:price => 2.50,:clearance => false}}, | |
{"ALMONDS" => {:price => 9.00, :clearance => false}}, | |
{"TEMPEH" => {:price => 3.00,:clearance => true}}, | |
{"CHEESE" => {:price => 6.50,:clearance => false}}, | |
{"BEER" => {:price => 13.00, :clearance => false}}, | |
{"PEANUTBUTTER" => {:price => 3.00,:clearance => true}}, |
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
def my_method | |
name_list = [] | |
%w[Sarah Sara Kate Keturah Chris Lavoisier Armando Derek].each do |name| | |
name_list << name | |
end | |
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
rainbow = [] | |
["red", "orange", "yellow", "green", "blue", "indigo", "violet"].each do |color| | |
rainbow << color | |
end | |
puts rainbow |
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
["red","yellow","green"].each do |color| | |
a = color | |
end | |
puts a |