Skip to content

Instantly share code, notes, and snippets.

View kenmazaika's full-sized avatar

ken mazaika kenmazaika

View GitHub Profile
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"
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"
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"
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"
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"
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
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
require 'minitest/autorun'
class TestStack < Minitest::Test
def test_stack
stack = Stack.new
stack.push(10)
stack.push(11)
stack.push(12)
class Stack
attr_reader :data
def initialize
@data = nil
end
# Push an item onto the stack
def push(element)
@data = LinkedList.new(element, @data)
class Dog
attr_accessor :name, :age, :owner_name
def initialize(name, age, owner_name)
@name = name
@age = age
@owner_name = owner_name
end