Indigo + RubyOSA

August 17th, 2007

Decided to quickly at lunch show rubyOSA and Indigo in action…

First open up IRB and require rubygems and rubyosa.


irb(main):001:0> require "rubygems" 
=> true
irb(main):002:0> require "rbosa" 
=> true

Then bind OSA to Indigo server (Indigo must be started)


irb(main):003:0> home = OSA.app('IndigoServer')
=> <OSA::IndigoServer::Application:0x24fc2f0 desc="'sign'($4F444E49$)">

As you can see here are a bunch of lights that in various states:

I want to turn all the lights in the house on. So I grab my new ‘home’ object and manipulate.


irb(main):004:0> home.all_lights_on
=> nil

As you can see now all the lights are on:

I decide it’s time to turn them all off so I grab that same ‘home’ object and shut them off.


irb(main):006:0> home.daylight? ? home.all_lights_off : home.all_lights_on 
=> nil

Tada… All the lights are now off:

There is much much more to come.

0 comments have been made on 'Indigo + RubyOSA'

Sorry, comments are closed for this article.

About


Pragmatic by design. Idealistic in nature. Short term pessimist. Long term optimist. Married with kids. Curious by nature.

Follow/Contact Me

Email:
  derek@integrumtech.com
Tumblr:
  brainspool


www.flickr.com

Archives

»

»

»

»

» May 2008 (1)

» April 2008 (2)

» March 2008 (2)

» February 2008 (5)

» January 2008 (8)

» December 2007 (13)

» November 2007 (16)

» October 2007 (4)

» September 2007 (6)

» August 2007 (6)

» July 2007 (1)

» June 2007 (1)

» May 2007 (9)

»

» March 2007 (3)

Community Oriented

RailsConf 2008

Recommend Me