This file contains hidden or 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 Image | |
| def initialize(array) | |
| @array = array | |
| end | |
| def output_image | |
| @array.each { |a| puts a.join } | |
| end |
This file contains hidden or 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 Deck | |
| attr_accessor :cards | |
| def initialize | |
| build_every_possible_card | |
| end | |
| def build | |
| self.cards = | |
| suits.map do |suit| |
This file contains hidden or 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 'pp' | |
| class Image | |
| attr_accessor :image | |
| def initialize(image) | |
| @image = image | |
| end | |
| def output_image | |
| @image.each do |e| |
This file contains hidden or 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 'minitest/autorun' | |
| require 'pp' | |
| module Luhn | |
| def self.is_valid?(number) | |
| each_digit(number).reverse.map.with_index do |e, i| | |
| r = e.to_i | |
| r *= 2 if i.odd? | |
| r -= 9 if r >= 10 | |
| r |
This file contains hidden or 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_relative 'video_game' | |
| require 'pp' | |
| wow = VideoGame.new(types: ['rpg'], genre: :mmo, name: 'World of warcraft') | |
| pp wow.types # => ['rpg'] | |
| wow.types = [] | |
| pp wow.types # => ['rpg'] | |
| puts 'game2' |
This file contains hidden or 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 'pp' | |
| class Image | |
| attr_accessor :array | |
| def initialize(array) | |
| @array = array | |
| end | |
| def output_image |
This file contains hidden or 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
| # config/initializers/carrierwave.rb | |
| CarrierWave.configure do |config| | |
| if Rails.env.production? | |
| config.root = Rails.root.join('tmp') | |
| config.cache_dir = 'carrierwave' | |
| config.storage = :fog | |
| config.fog_credentials = { | |
| :provider => 'AWS', | |
| :aws_access_key_id => ENV['S3_KEY_ID'], |
This file contains hidden or 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 'pp' | |
| class Card < Struct.new(:suit, :rank, :color) | |
| end | |
| class Deck | |
| attr_accessor :cards | |
| def initialize | |
| end |
This file contains hidden or 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
| diff --git a/Gemfile b/Gemfile | |
| index dd478e9..0454ddf 100644 | |
| --- a/Gemfile | |
| +++ b/Gemfile | |
| @@ -49,6 +49,7 @@ gem "geocoder" | |
| gem "figaro", ">= 1.0.0" | |
| gem 'carrierwave' | |
| +gem 'rmagick' | |
This file contains hidden or 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 Image | |
| def initialize(image) | |
| @image = image | |
| end | |
| #Iterate through @image input and identify which indices have a "1". | |
| def identify | |
| one_index = [] |