Create a gist now

Instantly share code, notes, and snippets.

{
"people":[
{
"person":{
"animals":[
{
"animal":{
"id":416016843,
"name":"Poiyo",
"pet_type":"fish",
"toys":[
{
"toy":{
"id":927160714,
"label":"LHC",
"pet_id":"416016843",
"price":1000000,
"railsize":"We are happy to code with power of Ruby and Rails",
"toy_id":"927160714"
}
},
{
"toy":{
"id":893961453,
"label":"Humanity",
"pet_id":"416016843",
"price":10,
"railsize":"We are happy to code with power of Ruby and Rails",
"toy_id":"893961453"
}
}
]
}
}
],
"enhanced_name":"Eugene!!!",
"hello_world":"Hello world!",
"login":"Eugene"
}
},
{
"person":{
"animals":[
{
"animal":{
"id":992251607,
"name":"Skooby Doo",
"pet_type":"dog",
"toys":[
{
"toy":{
"id":893961453,
"label":"Humanity",
"pet_id":"992251607",
"price":10,
"railsize":"We are happy to code with power of Ruby and Rails",
"toy_id":"893961453"
}
},
{
"toy":{
"id":850957175,
"label":"continents",
"pet_id":"992251607",
"price":1000,
"railsize":"We are happy to code with power of Ruby and Rails",
"toy_id":"850957175"
}
}
]
}
}
],
"enhanced_name":"Ivan!!!",
"hello_world":"Hello world!",
"login":"Ivan"
}
}
]
}
-@humans => people
:only
.name => login
:code => enhanced_name
name + "!!!"
:code => hello_world
"Hello world!"
+pets => animals
:except
.human_id
.pet_type_id
+toys
:methods
.railsize("We ","are happy ","to code ","with power of X ","and Y")
<pet_type
:only
.class_name => pet_type
@webile-android

Can somebody decode and explain how to display it normal html..

@humans.each do |person|
puts "login:"+person.name
puts ","
puts "enhanced_name:"+person.name+"!!!"
...
...
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment