class Thing
Attributes
Public Properties.
Public Properties.
Public Properties.
Public Properties.
Public Properties.
Public Properties.
Public Class Methods
Constructor method for Thing
.
@param [WebService] webService A web service used to communicate with Thingdom
. @param [String] name The name of the Thing
. @param [String] productType The product type the Thing
belongs to. @param [String] displayName A user friendly name for Thing
.
# File lib/thing.rb, line 22 def initialize( webService, name, productType = '', displayName = '' ) @web = webService @id = '' @name = name @product_type = productType @display_name = displayName @code = '' # # Perform task to get thing. # thingTask = ThingTask.new( @web, self ) response = thingTask.perform() # # If successful, then update the thing id and code. # if( response[:response] == 'success' ) @id = response[:thing_id] @code = response[:code] end end
Public Instance Methods
Send a feed with additional feed options.
@param [String] category A feed category that was defined during application registration. @param [String] message The feed message. @param [FeedOption] feedOptions Additional feed options: icon, progress bar, etc.
# File lib/thing.rb, line 50 def feed( category, message, feedOptions = nil ) feedTask = FeedTask.new( @web, self, category, message, feedOptions ) feedTask.perform() end
Add or update a status item for this Thing
.
@param [String] name The status item name. @param [String] value The status item value. @param [String] unit The status item unit.
# File lib/thing.rb, line 62 def status( *args ) statusTask = StatusTask.new( @web, self, *args ) statusTask.perform() end