thingdom 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Thingdom Ruby Module
2
2
  ===========
3
3
 
4
- Ruby module for v1.1 of the [Thingdom.io API](https://thingdom.io/).
4
+ The official Ruby wrapper for the [Thingdom API](https://thingdom.io/).
5
5
 
6
6
  ## What is Thingdom?
7
7
 
@@ -1,6 +1,17 @@
1
-
1
+ #
2
+ # A psuedo abstract class that provides common functionality for performing Thing tasks.
3
+ # These are: retrieving a thing, updating status and sending a feed.
4
+ #
2
5
  class BaseTask
3
6
 
7
+ #
8
+ # Constructor method for base task. Initialize web service and the thing for which
9
+ # tasks will be performed.
10
+ #
11
+ # @param [WebService] webService A web service to be used by the task.
12
+ # @param [Thing] thing The thing for which the task is being performed.
13
+ # @param [boolean] isThingTask True if the task is retrieving or creating a thing.
14
+ #
4
15
  def initialize( webService, thing, isThingTask )
5
16
  @web = webService
6
17
  @thing = thing
@@ -1,7 +1,13 @@
1
+ #
2
+ # A class that does the work for adding a feed to a thing.
3
+ #
1
4
  require_relative( 'baseTask' )
2
5
 
3
6
  class FeedTask < BaseTask
4
7
 
8
+ #
9
+ # Constructor method for feed task. Initialize feed attributes.
10
+ #
5
11
  def initialize( webService, thing, category, message, feedOptions )
6
12
  super( webService, thing, false )
7
13
  @web = webService
@@ -11,6 +17,9 @@ class FeedTask < BaseTask
11
17
  @feedOptions = feedOptions
12
18
  end
13
19
 
20
+ #
21
+ # Do the work for the feed task.
22
+ #
14
23
  def do_task_work
15
24
  @web.add_feed( @thing, @category, @message, @feedOptions )
16
25
  end
@@ -1,7 +1,13 @@
1
+ #
2
+ # A class that does the work for updating the status for a thing.
3
+ #
1
4
  require_relative( 'baseTask' )
2
5
 
3
6
  class StatusTask < BaseTask
4
7
 
8
+ #
9
+ # Constructor method for status task. Initialize status update array.
10
+ #
5
11
  def initialize( webService, thing, *args )
6
12
  super( webService, thing, false )
7
13
  @web = webService
@@ -9,6 +15,9 @@ class StatusTask < BaseTask
9
15
  @statusUpdates = statusArgsToArray( *args )
10
16
  end
11
17
 
18
+ #
19
+ # Do the work for the status task.
20
+ #
12
21
  def do_task_work
13
22
  @web.add_status( @thing, @statusUpdates )
14
23
  end
@@ -1,13 +1,22 @@
1
+ #
2
+ # A class that does the work for creating or retrieving a thing.
3
+ #
1
4
  require_relative ( 'baseTask' )
2
5
 
3
6
  class ThingTask < BaseTask
4
7
 
8
+ #
9
+ # The constructor method for thing task.
10
+ #
5
11
  def initialize( webService, thing )
6
12
  super( webService, thing, true )
7
13
  @web = webService
8
- @thing = @thing
14
+ @thing = thing
9
15
  end
10
16
 
17
+ #
18
+ # Do the work for the thing task.
19
+ #
11
20
  def do_task_work
12
21
  @web.add_thing( @thing )
13
22
  end
@@ -1,3 +1,3 @@
1
1
  module Thingdom
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -32,7 +32,8 @@ class WebService
32
32
  # @return [Hash] A hash containing the authorization response:
33
33
  # application_token - The token used in subsequent communications with Thingdom
34
34
  # expires_in - The number of seconds remaining before above token expires.
35
- # device_secret - A unique identifier for device running this application (always ruby in this case)
35
+ # device_secret - A unique identifier for device running this application
36
+ # (always "none" for the Ruby wrapper)
36
37
  #
37
38
  def get_authorization()
38
39
  data = {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thingdom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: