share_counter 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/share_counter/version.rb +1 -1
- data/lib/share_counter.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f98aa6a9350226175cf57c1dd5211c1cfee2915c
|
4
|
+
data.tar.gz: bf35960f6f7e67d5fa3a628289a6149832043b97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44d9ef6ce648d9870f1a0bd49b6a38355f229aa3ea2178df58eca58c5076e97a930cea65a2ea4071ecd286a10fb7d6a97f17feeb6b44870d129a6eabf683f1a2
|
7
|
+
data.tar.gz: ce544854516093532503798fea07ec3baca91951d0dc43ac44b4887bff291fd7d2f2c7386566b2ea2679523c4d7064d094d39a86558b034fcd0e61297a008d0f
|
data/lib/share_counter.rb
CHANGED
@@ -69,10 +69,18 @@ module ShareCounter
|
|
69
69
|
%w(reddit twitter facebook linkedin stumbleupon pinterest)
|
70
70
|
end
|
71
71
|
|
72
|
+
def self.supported_major_networks
|
73
|
+
%w(reddit twitter facebook linkedin)
|
74
|
+
end
|
75
|
+
|
72
76
|
def self.all url
|
73
77
|
supported_networks.inject({}) { |r, c| r[c.to_sym] = ShareCounter.send(c, url); r }
|
74
78
|
end
|
75
79
|
|
80
|
+
def self.major url
|
81
|
+
supported_major_networks.inject({}) { |r, c| r[c.to_sym] = ShareCounter.send(c, url); r }
|
82
|
+
end
|
83
|
+
|
76
84
|
def self.selected url, selections
|
77
85
|
selections.map{|name| name.downcase}.select{|name| supported_networks.include? name.to_s}.inject({}) {
|
78
86
|
|r, c| r[c.to_sym] = ShareCounter.send(c, url); r }
|