Created
May 24, 2009 00:12
-
-
Save yuiseki/116886 to your computer and use it in GitHub Desktop.
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
require "rubygems" | |
gem "activeresource" | |
require "active_resource" | |
require "serialport" | |
class State < ActiveResource::Base | |
self.site = 'http://cyberia.yuiseki.net/' | |
end | |
#5秒おきにRailsに問い合わせて出力する | |
loop { | |
data = State.find(:last) # 最新データ | |
puts data.inspect | |
puts "\n" | |
puts data.power # 勝手にメソッドができてる | |
puts data.blue | |
#data2 = Shop.find(:first) # 一番最初に投入された古いデータ | |
sleep 5 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment