nike_v2 0.2.2 → 0.2.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.
- data/lib/ext/core_ext.rb +0 -14
- data/lib/nike_v2/activities.rb +9 -1
- data/lib/nike_v2/version.rb +1 -1
- data/lib/nike_v2.rb +2 -2
- metadata +1 -1
data/lib/ext/core_ext.rb
CHANGED
@@ -6,18 +6,4 @@ class String
|
|
6
6
|
tr("-", "_").
|
7
7
|
downcase
|
8
8
|
end
|
9
|
-
def ss_camelize(first_letter_in_uppercase = false)
|
10
|
-
lower_case_and_underscored_word = self.to_s
|
11
|
-
if first_letter_in_uppercase
|
12
|
-
lower_case_and_underscored_word.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
|
13
|
-
else
|
14
|
-
lower_case_and_underscored_word[0].downcase + lower_case_and_underscored_word.camelize[1..-1]
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
class Symbol
|
20
|
-
def ss_camelize(first_letter_in_uppercase = false)
|
21
|
-
self.to_s.ss_camelize.to_sym
|
22
|
-
end
|
23
9
|
end
|
data/lib/nike_v2/activities.rb
CHANGED
@@ -57,7 +57,15 @@ module NikeV2
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def extract_api_args(args)
|
60
|
-
args.inject({}){|h,a| h[a.first
|
60
|
+
args.inject({}){|h,a| h[camelize_word(a.first)] = a.last if API_ARGS.include?(a.first); h}
|
61
|
+
end
|
62
|
+
|
63
|
+
def camelize_word(word, first_letter_in_uppercase = false)
|
64
|
+
if !!first_letter_in_uppercase
|
65
|
+
word.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
|
66
|
+
else
|
67
|
+
(word[0].to_s.downcase + camelize_word(word, true)[1..-1]).to_sym
|
68
|
+
end
|
61
69
|
end
|
62
70
|
|
63
71
|
def fetch_and_build_activities
|
data/lib/nike_v2/version.rb
CHANGED
data/lib/nike_v2.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'alchemist'
|
2
|
+
require 'forwardable'
|
3
|
+
require 'ext/core_ext'
|
2
4
|
|
3
5
|
require 'nike_v2/base'
|
4
6
|
require 'nike_v2/metric'
|
@@ -10,5 +12,3 @@ require 'nike_v2/activity'
|
|
10
12
|
require 'nike_v2/activities'
|
11
13
|
require 'nike_v2/summary'
|
12
14
|
require 'nike_v2/gps_data'
|
13
|
-
|
14
|
-
require 'ext/core_ext'
|