Skip to content

Instantly share code, notes, and snippets.

View edipofederle's full-sized avatar
🏠
Working from home

Édipo Féderle edipofederle

🏠
Working from home
View GitHub Profile
class Matematica
def initialize(x,y)
@x, @y
end
end
mat = Matematica.new(1,4)
class Matematica
def initialize(x,y)
@x = x
@y = y
end
def to_s
"(#@x,#@y)"
end
end
class Matematica
def initialize(x,y)
@x = x
@y = y
end
end
m = Matematica.new(3,4)
puts m
class Pessoa
def hello
puts 'Hello'
end
end
class Product < ActiveRecord::Base
validates_presence_of :nome, :descricao
end
class CreateProducts < ActiveRecord::Migration
def self.up
create_table :products do |t|
t.string :nome
t.text :descricao
t.timestamps
end
end
def self.down
drop_table :products
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
@Entity
public class Product implements Serializable {
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
public class test_stack{
private Stack ste;
@Before
public class Stack {
private Element top;
private Integer tam;
private Element temp;
public Stack(){
this.top = null;
this.tam = 0;