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 Card | |
| attr_accessor :rank, :suit | |
| def initialize(rank, suit) | |
| self.rank = rank | |
| self.suit = suit | |
| end | |
| def output_card | |
| print self.rank, " of ", self.suit, "\n" |
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 Card | |
| attr_accessor :rank, :suit | |
| def initialize(rank, suit) | |
| self.rank = rank | |
| self.suit = suit | |
| end | |
| def output_card | |
| print self.rank, " of ", self.suit, "\n" |
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 Card | |
| attr_accessor :rank, :suit | |
| def initialize(rank, suit) | |
| self.rank = rank; | |
| self.suit = suit; | |
| end | |
| def output_card | |
| print self.rank, " of ", self.suit, "\n" |
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 Card | |
| attr_accessor :rank, :suit | |
| def initialize(rank, suit) | |
| self.rank = rank; | |
| self.suit = suit; | |
| end | |
| def output_card | |
| print self.rank, " of ", self.suit, "\n" |
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 Card | |
| attr_accessor :rank, :suit | |
| def initialize(rank, suit) | |
| self.rank = rank; | |
| self.suit = suit; | |
| end | |
| def output_card | |
| print self.rank, " of ", self.suit, "\n" |
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 User < ActiveRecord::Base | |
| # Include default devise modules. Others available are: | |
| # :confirmable, :lockable, :timeoutable and :omniauthable | |
| devise :database_authenticatable, :registerable, | |
| :recoverable, :rememberable, :trackable, :validatable | |
| has_many :places | |
| has_many :comments | |
| has_many :photos |
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 User < ActiveRecord::Base | |
| # Include default devise modules. Others available are: | |
| # :confirmable, :lockable, :timeoutable and :omniauthable | |
| devise :database_authenticatable, :registerable, | |
| :recoverable, :rememberable, :trackable, :validatable | |
| has_many :places | |
| has_many :comments | |
| has_many :photos |
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' | |
| class TestStack < Minitest::Test | |
| def test_stack | |
| stack = Stack.new | |
| stack.push(10) | |
| stack.push(11) | |
| stack.push(12) |
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 Stack | |
| attr_reader :data | |
| def initialize | |
| @data = nil | |
| end | |
| # Push an item onto the stack | |
| def push(element) | |
| @data = LinkedList.new(element, @data) |
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 Dog | |
| attr_accessor :name, :age, :owner_name | |
| def initialize(name, age, owner_name) | |
| @name = name | |
| @age = age | |
| @owner_name = owner_name | |
| end |