simple_analytics_api 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7a2363c648b5d9e7701ed484a8c5672571061099ff6c1c5763dae0049226493
4
- data.tar.gz: c54fd3de26899bdf1c94fdb8f1cea8e9fb479de3ceddd3ee938634bbb08533b6
3
+ metadata.gz: ad37e11e9775b0df35b8576f8ed0f3152ba4a363434a11b348297dca6f11ada8
4
+ data.tar.gz: c685fb99c7350ae58d7bf8771ff12f55d0b56931de1383e679b206b31afd643e
5
5
  SHA512:
6
- metadata.gz: a2e722f773e5fe8fa23d8277d9bbbf80413ad8e79bc8ea6b1b04dfb96526918862d473374dd0abe2813f3a5d3b1d3476c98ed3c54e323870a9d6417cada20a3b
7
- data.tar.gz: ecb85271ac70fc4089a4fca80462476fd06202157d77e724c404a4fd423220096621ffa98d93fe27c1561ddf89e9be84fc9980c05be0863c157de7bdf7a03315
6
+ metadata.gz: e4713798681903cf286e1779b66726f4ffb2873a64d13528ec98571ca29008e69c16f6859173d86238488eda3e792f1e340964324e553c1b09b022776328be7a
7
+ data.tar.gz: d1c6c6fe3a52a510426072daca08361604c2371158cc0dbca879dde91e36e3a2061451a3eeacc83cea1611000936a680c9b59aa1c2c1c76725f9fd6ca3c2dca8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_analytics_api (0.0.1)
4
+ simple_analytics_api (0.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -5,7 +5,7 @@ module SimpleAnalyticsApi
5
5
 
6
6
  attr_accessor :api_key, :user_id, :domain
7
7
 
8
- def initialize(api_key: nil, user_id: nil, domain:)
8
+ def initialize(api_key: nil, user_id: nil, domain: nil)
9
9
  @api_key = api_key.to_s
10
10
  @user_id = user_id.to_s
11
11
  @domain = domain.to_s
@@ -15,6 +15,10 @@ module SimpleAnalyticsApi
15
15
  run.ok rescue false
16
16
  end
17
17
 
18
+ def websites
19
+ Website.new(client: self).run
20
+ end
21
+
18
22
  def run(fields: [], filters: {})
19
23
  Resource.new(client: self, fields: fields, filters: filters).run
20
24
  end
@@ -10,7 +10,6 @@ module SimpleAnalyticsApi
10
10
  @fields = fields
11
11
  @filters = filters
12
12
  @domain = domain || client.domain
13
- @errors = []
14
13
  @filters[:version] = 5 unless @filters[:version]
15
14
  @fields = [:pageviews] unless @fields.any?
16
15
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleAnalyticsApi
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,15 @@
1
+ module SimpleAnalyticsApi
2
+ class Website < Resource
3
+
4
+ attr_accessor :client
5
+
6
+ def initialize(client:)
7
+ @client = client
8
+ end
9
+
10
+ def url
11
+ "#{BASE_URL}/api/websites"
12
+ end
13
+
14
+ end
15
+ end
@@ -10,5 +10,6 @@ module SimpleAnalyticsApi
10
10
  autoload :Error, "simple_analytics_api/error"
11
11
 
12
12
  autoload :Resource, "simple_analytics_api/resource"
13
+ autoload :Website, "simple_analytics_api/website"
13
14
  autoload :Object, "simple_analytics_api/object"
14
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_analytics_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gustavo Garcia
@@ -32,6 +32,7 @@ files:
32
32
  - lib/simple_analytics_api/object.rb
33
33
  - lib/simple_analytics_api/resource.rb
34
34
  - lib/simple_analytics_api/version.rb
35
+ - lib/simple_analytics_api/website.rb
35
36
  - simple_analytics_api.gemspec
36
37
  homepage: https://github.com/dailytics/simpleanalytics_api
37
38
  licenses: