restpack-group-client 0.0.42 → 0.0.43

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,6 +34,10 @@ module RestPack
34
34
  #TODO: GJ: require channel_id
35
35
  hydrate http_get("/api/v1/groups/#{id}.json")
36
36
  end
37
+
38
+ def create(params)
39
+ http_post("/api/v1/groups", :group => params)
40
+ end
37
41
  end
38
42
 
39
43
  class MembershipApi < BaseApi
@@ -4,7 +4,7 @@ module RestPack
4
4
  module Client
5
5
  class Api #TODO: GJ: move to common client gem
6
6
  attr_accessor :options
7
- def initialize(options = {})
7
+ def initialize(options = {})
8
8
  @options = {
9
9
  use_https: true,
10
10
  domain: 'localhost:1113',
@@ -18,6 +18,12 @@ module RestPack
18
18
  json = RestClient.get(url, params: params)
19
19
  Yajl::Parser.parse(json, :symbolize_keys => true)
20
20
  end
21
+
22
+ def http_post(path, params = {})
23
+ url = build_url(path)
24
+ json = RestClient.post(url, params: params)
25
+ Yajl::Parser.parse(json, :symbolize_keys => true)
26
+ end
21
27
 
22
28
  def build_url(path)
23
29
  protocol = @options[:use_https] ? "https://" : "http://"
@@ -1,7 +1,7 @@
1
1
  module RestPack
2
2
  module Group
3
3
  module Client
4
- VERSION = "0.0.42"
4
+ VERSION = "0.0.43"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restpack-group-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.42
4
+ version: 0.0.43
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: