awis-sdk-ruby 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -152,7 +152,7 @@ Returns object that contains relationships:
152
152
 
153
153
  ##### Request ID and Status Code
154
154
 
155
- You can retrieve status code and request id
155
+ You can retrieve status code and requestID
156
156
 
157
157
  * request_id
158
158
  * status_code
@@ -11,6 +11,10 @@ module Awis
11
11
  self
12
12
  end
13
13
 
14
+ def request_description_params
15
+ arguments[:descriptions].to_s.capitalize
16
+ end
17
+
14
18
  def parsed_body
15
19
  @parsed_body ||= MultiXml.parse(response_body)
16
20
  end
@@ -28,17 +28,13 @@ module Awis
28
28
  "Action" => action_name,
29
29
  "ResponseGroup" => response_groups,
30
30
  "Path" => arguments[:path],
31
- "Descriptions" => descriptions_params
31
+ "Descriptions" => request_description_params
32
32
  }
33
33
  end
34
34
 
35
35
  def response_groups
36
36
  arguments[:response_group].sort.map { |group| camelize(group) }.join(",")
37
37
  end
38
-
39
- def descriptions_params
40
- arguments[:descriptions].to_s.capitalize
41
- end
42
38
  end
43
39
  end
44
40
  end
@@ -28,11 +28,11 @@ module Awis
28
28
 
29
29
  def params
30
30
  {
31
- "Action" => "CategoryListings",
32
- "ResponseGroup" => DEFAULT_RESPONSE_GROUP[0],
31
+ "Action" => action_name,
32
+ "ResponseGroup" => response_groups,
33
33
  "Path" => arguments[:path],
34
34
  "Recursive" => recursive_param,
35
- "Descriptions" => descriptions_params,
35
+ "Descriptions" => request_description_params,
36
36
  "SortBy" => sort_by_param,
37
37
  "Count" => arguments[:count],
38
38
  "Start" => arguments[:start],
@@ -43,13 +43,13 @@ module Awis
43
43
  arguments[:recursive].to_s.capitalize
44
44
  end
45
45
 
46
- def descriptions_params
47
- arguments[:descriptions].to_s.capitalize
48
- end
49
-
50
46
  def sort_by_param
51
47
  camelize(arguments[:sort_by])
52
48
  end
49
+
50
+ def response_groups
51
+ DEFAULT_RESPONSE_GROUP.map { |group| camelize(group) }.join(",")
52
+ end
53
53
  end
54
54
  end
55
55
  end
@@ -20,13 +20,17 @@ module Awis
20
20
 
21
21
  def params
22
22
  {
23
- "Action" => "SitesLinkingIn",
23
+ "Action" => action_name,
24
24
  "Url" => arguments[:url],
25
- "ResponseGroup" => DEFAULT_RESPONSE_GROUP[0],
25
+ "ResponseGroup" => response_groups,
26
26
  "Count" => arguments[:count],
27
27
  "Start" => arguments[:start]
28
28
  }
29
29
  end
30
+
31
+ def response_groups
32
+ DEFAULT_RESPONSE_GROUP.map { |group| camelize(group) }.join(",")
33
+ end
30
34
  end
31
35
  end
32
36
  end
@@ -1,6 +1,8 @@
1
1
  module Awis
2
2
  module API
3
3
  class TrafficHistory < Base
4
+ DEFAULT_RESPONSE_GROUP = %w(history).freeze
5
+
4
6
  def load_request_uri(arguments = {})
5
7
  validation_arguments!(arguments)
6
8
 
@@ -10,11 +12,11 @@ module Awis
10
12
  private
11
13
  def params
12
14
  {
13
- "Action" => "TrafficHistory",
15
+ "Action" => action_name,
14
16
  "Url" => arguments[:url],
15
- "ResponseGroup" => "History",
17
+ "ResponseGroup" => response_groups,
16
18
  "Range" => arguments[:range],
17
- "Start" => start_param,
19
+ "Start" => start_date,
18
20
  }
19
21
  end
20
22
 
@@ -26,9 +28,13 @@ module Awis
26
28
  @arguments[:start] = arguments.fetch(:start) { Time.now - (3600 * 24 * @arguments[:range].to_i) }
27
29
  end
28
30
 
29
- def start_param
31
+ def start_date
30
32
  arguments[:start].respond_to?(:strftime) ? arguments[:start].strftime("%Y%m%d") : arguments[:start]
31
33
  end
34
+
35
+ def response_groups
36
+ DEFAULT_RESPONSE_GROUP.map { |group| camelize(group) }.join(",")
37
+ end
32
38
  end
33
39
  end
34
40
  end
@@ -207,9 +207,12 @@ module Awis
207
207
  end
208
208
 
209
209
  class UsageStatistic < BaseEntity
210
- attr_accessor :time_range_months, :time_range_days, :rank_value, :rank_delta, :reach_rank_value, :reach_rank_delta,
211
- :reach_per_million_value, :reach_per_million_delta, :reach_page_views_per_million_value, :reach_page_views_per_million_delta,
212
- :reach_page_views_rank_value, :reach_page_views_rank_delta, :reach_page_views_per_user_value, :reach_page_views_per_user_delta
210
+ attr_accessor :time_range_months, :time_range_days, :rank_value, :rank_delta,
211
+ :reach_rank_value, :reach_rank_delta,
212
+ :reach_per_million_value, :reach_per_million_delta,
213
+ :reach_page_views_per_million_value, :reach_page_views_per_million_delta,
214
+ :reach_page_views_rank_value, :reach_page_views_rank_delta,
215
+ :reach_page_views_per_user_value, :reach_page_views_per_user_delta
213
216
 
214
217
  def range_type
215
218
  return 'month' unless time_range_months.blank?
@@ -1,3 +1,3 @@
1
1
  module Awis
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awis-sdk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  version: '0'
168
168
  segments:
169
169
  - 0
170
- hash: 3226589619329212718
170
+ hash: 4148590925117238172
171
171
  requirements: []
172
172
  rubyforge_project:
173
173
  rubygems_version: 1.8.23