Created
February 6, 2013 15:31
-
-
Save fermuch/4723295 to your computer and use it in GitHub Desktop.
Testing Opal with Opal-JQuery :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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