gravis-floobs 0.1.2 → 0.1.3

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.
Files changed (3) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/floobs/channel.rb +45 -14
  3. metadata +1 -1
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 2
4
+ :patch: 3
@@ -1,25 +1,56 @@
1
1
  module Floobs
2
2
  class Channel < Floobs::Base
3
-
4
- def self.find(channel_id,live)
5
- if live
6
- query = {:id => channel_id, :live => live}
7
- else
8
- query = {:id => channel_id}
9
- end
3
+
4
+ # Finds a channel by its id
5
+ #
6
+ # Params:
7
+ # * +channel_id+ : Channel ID
8
+ #
9
+ # Options:
10
+ # * +live+ : (+true+ or +false+) Filter channels. Do not send the param if you don't want to filter
11
+ #
12
+ def self.find(channel_id, options)
13
+ query = {:id => channel_id}.merge(options)
10
14
  get("/channels.service", query)
11
15
  end
12
16
 
13
- def self.find_all_by_user_name(username,live=true)
14
- get("/channels.service", :query => {:userName => username.to_a.join(' or '), :live => live})
17
+ # Finds a channel by its username
18
+ #
19
+ # Params:
20
+ # * +username+ : Username as a #String
21
+ #
22
+ # Options:
23
+ # * +live+ : (+true+ or +false+) Filter channels. Do not send the param if you don't want to filter
24
+ #
25
+ def self.find_all_by_user_name(username,options)
26
+ query = {:username => username}.merge(options)
27
+ get("/channels.service", query)
15
28
  end
16
29
 
17
- def self.find_all_by_channel_name(channel_name,live=true)
18
- get("/channels.service", :query => {:channelName => channel_name.to_a.join(' or '), :live => live})
30
+ # Finds a channel by its name
31
+ #
32
+ # Params:
33
+ # * +channel_name+ : Channel name as a #String
34
+ #
35
+ # Options:
36
+ # * +live+ : (+true+ or +false+) Filter channels. Do not send the param if you don't want to filter
37
+ #
38
+ def self.find_all_by_channel_name(channel_name,options)
39
+ query = {:channel_name => channel_name}.merge(options)
40
+ get("/channels.service", query)
19
41
  end
20
-
21
- def self.find_all_by_tag(tags,live=true)
22
- get("/channels.service", :query => {:tag => tags.to_a.join(' and '), :live => live})
42
+
43
+ # Finds a channel by its name
44
+ #
45
+ # Params:
46
+ # * +tag+ : A tag as a #String
47
+ #
48
+ # Options:
49
+ # * +live+ : (+true+ or +false+) Filter channels. Do not send the param if you don't want to filter
50
+ #
51
+ def self.find_all_by_tag(tag,options)
52
+ query = {:tag => tag}.merge(options)
53
+ get("/channels.service", query)
23
54
  end
24
55
 
25
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gravis-floobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philippe Lafoucriere