Class: Thing
- Inherits:
-
Object
- Object
- Thing
- Defined in:
- lib/thing.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Public Properties.
-
#display_name ⇒ Object
Public Properties.
-
#id ⇒ Object
Public Properties.
-
#last_error ⇒ Object
Public Properties.
-
#name ⇒ Object
Public Properties.
-
#product_type ⇒ Object
Public Properties.
Instance Method Summary collapse
-
#feed(category, message, feedOptions = nil) ⇒ Object
Send a feed with additional feed options.
-
#initialize(webService, name, productType = '', displayName = '') ⇒ Thing
constructor
Constructor method for Thing.
-
#status(*args) ⇒ Object
Add or update a status item for this Thing.
Constructor Details
#initialize(webService, name, productType = '', displayName = '') ⇒ Thing
Constructor method for Thing.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# 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 |
Instance Attribute Details
#code ⇒ Object
Public Properties.
12 13 14 |
# File 'lib/thing.rb', line 12 def code @code end |
#display_name ⇒ Object
Public Properties.
12 13 14 |
# File 'lib/thing.rb', line 12 def display_name @display_name end |
#id ⇒ Object
Public Properties.
12 13 14 |
# File 'lib/thing.rb', line 12 def id @id end |
#last_error ⇒ Object
Public Properties.
12 13 14 |
# File 'lib/thing.rb', line 12 def last_error @last_error end |
#name ⇒ Object
Public Properties.
12 13 14 |
# File 'lib/thing.rb', line 12 def name @name end |
#product_type ⇒ Object
Public Properties.
12 13 14 |
# File 'lib/thing.rb', line 12 def product_type @product_type end |
Instance Method Details
#feed(category, message, feedOptions = nil) ⇒ Object
Send a feed with additional feed options.
50 51 52 53 |
# File 'lib/thing.rb', line 50 def feed( category, , feedOptions = nil ) feedTask = FeedTask.new( @web, self, category, , feedOptions ) feedTask.perform() end |
#status(*args) ⇒ Object
Add or update a status item for this Thing.
62 63 64 65 |
# File 'lib/thing.rb', line 62 def status( *args ) statusTask = StatusTask.new( @web, self, *args ) statusTask.perform() end |