ruby-sendhub 0.0.1 → 0.0.2

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
@@ -12,7 +12,7 @@ A SendHub account. Get your API key [here](https://www.sendhub.com/settings)
12
12
 
13
13
  ##Usage
14
14
 
15
- Currently, only two methods are implemented as this is my first Gem ever. Woohoo! "cries"
15
+ Currently, only three methods are implemented as this is my first Gem ever. Woohoo! "cries"
16
16
 
17
17
  Create a new instance of the API wrapper:
18
18
 
@@ -22,9 +22,13 @@ Now you grab the contacts you have. You need the contact id to send any message
22
22
 
23
23
  sh.get_contacts
24
24
 
25
- Once you grabbed the contacts you can send messages to the contact(s) by
25
+ Or grab all the groups
26
26
 
27
- sh.send_message("Your message here", *id)
27
+ sh.get_groups
28
+
29
+ Once you grabbed the contacts you can send messages to the contact(s) or group(s) by
30
+
31
+ sh.send_message("Your message here", *group_ids, *contact_ids)
28
32
 
29
33
  ##Special Thanks
30
34
 
data/lib/ruby-sendhub.rb CHANGED
@@ -19,6 +19,11 @@ class SendHub
19
19
  c.parsed_response['objects']
20
20
  end
21
21
 
22
+ def get_groups
23
+ c = self.class.get base_url + "groups" + credentials
24
+ c.parsed_response['objects']
25
+ end
26
+
22
27
  def send_message(message, *args)
23
28
  api_url = base_url + "messages" + credentials
24
29
  m = { :contacts => args, :text => message }
@@ -1,5 +1,5 @@
1
1
  module Ruby
2
2
  module Sendhub
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-sendhub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
16
- requirement: &14589000 !ruby/object:Gem::Requirement
16
+ requirement: &17276540 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *14589000
24
+ version_requirements: *17276540
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &14588400 !ruby/object:Gem::Requirement
27
+ requirement: &17265300 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *14588400
35
+ version_requirements: *17265300
36
36
  description: My first gem and no tests yet. Ruby wrapper for SendHub API
37
37
  email:
38
38
  - dude@owyong.sk