Skip to content

Instantly share code, notes, and snippets.

while true
print(">>>")
read_input = gets
puts eval(read_input)
end
while true
print(">>>")
read_input = gets
puts eval(read_input)
end
class Person
puts "at the start of person class"
end
class Person
puts "at the starting of person class"
def initialize name, age
@name = name
@age = age
end
puts "at the end of person class"
end
class Person
puts "at the starting of person class"
###### Look Here ########
def self.my_attr_reader variable_name
evaluate_string = "def #{variable_name} \n" +
"return @#{variable_name} \n" +
"end \n"
eval(evaluate_string)
end
def name
return @name
end
class Person
puts "at the starting of person class"
def self.my_attr_reader variable_name
evaluate_string = "def #{variable_name} \n" +
"return @#{variable_name} \n" +
"end \n"
eval(evaluate_string)
end
my_attr_reader "name"
def initialize name, age
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Swagger Petstore",
"description": "A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "Swagger API Team",
"email": "apiteam@swagger.io",
@tushartuteja
tushartuteja / docker-compose.yml
Created December 15, 2018 16:41
Docker compose
version: '3'
services:
db:
image: postgres
volumes:
- ./tmp/db:/var/lib/postgresql/data
web:
build: .
volumes:
- .:/myapp
@tushartuteja
tushartuteja / docker-compose.yml
Created December 15, 2018 16:42
docker compose for rails and postgres
version: '3'
services:
db:
image: postgres
volumes:
- ./tmp/db:/var/lib/postgresql/data
web:
build: .
volumes:
- .:/myapp