Skip to content

Instantly share code, notes, and snippets.

@fermuch
Created February 6, 2013 15:31
Show Gist options
  • Save fermuch/4723295 to your computer and use it in GitHub Desktop.
Save fermuch/4723295 to your computer and use it in GitHub Desktop.
Testing Opal with Opal-JQuery :)
class Vehicle
attr_accessor :name, :wheels
end
class Car < Vehicle
def initialize(name)
self.name = name
self.wheels = 4
end
end
class Moto < Vehicle
def initialize(name)
self.name = name
self.wheels = 2
end
end
vehicles = []
vehicles << Car.new('Fitito')
vehicles << Moto.new('Kawazaki')
vehicles.each do |i|
puts "#{i.name}: #{i.wheels} ruedas"
end
HTTP.post('http://10.0.0.254:5000/api/event/section?section=PC&id=50dba5d6c77c941557000002') do |response|
puts response.json.first['name']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment