nerd_log 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWE0ZWMwN2I4NjhlMDIxYThiNmM2ODAzNGEyZjdjMmM2OTk4ZWMzMw==
4
+ MWVhMDBkZjNkOTIyOTBkNzA3Njc3NGM0YTk5YzUwNTc4ZWNmMzNmNw==
5
5
  data.tar.gz: !binary |-
6
- OTFlYjVkM2MyNjhiMmEyYTA1ZDlkNTNmY2JlMjk1MjEyOTNmOTZhMA==
6
+ NzY5YjkzOTI2MWJjM2NmNmM4NzY5YzY1YzhiOWRjYmM3OWVhNDNkZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmJjYzA2Y2Y5Yjg0NjYzMjI4NTA0YjIyZTM4ODk4N2UxMWU5NmMwNjlmNTQz
10
- MDkzN2ZhNzg0ZGFlMjc0NjBhNDE4MmJhYTE5NjUyNGE1ZTk0YjQzNWM5YjZh
11
- YTU1MGVhNGI4YWJkN2ZhMjNlYmUyNmM3NzEwZDc0ODE0OWI1NmQ=
9
+ ZDcxZWJkNmM3Y2Q1Njg1MjhiMzEyZTUyNTU5ZTdkODc3ZTY3Y2NjYmQxZGJj
10
+ ZjE1YWI1ZjUxMTg0Mjg3NTNmOTVjNDNmOGRlM2YwZTg4NDVjOGIxODcxNmI1
11
+ OGY1MTA0ODBkOWVlY2ZjYjFlYWUzODVlYzA2ZDAzZjBkZTU1MmU=
12
12
  data.tar.gz: !binary |-
13
- ODRkY2U3ODg5MzY5NzM4MmUxNWQ0NDdkMzJlMDk1YWQ1YzQ0M2I1MjAwNjc5
14
- NmRkMGFmNmE5YTUyNDQxNDkyMzY4ODZhMGVhMmJkZDIzYjdjYmI1ZWJhM2Rj
15
- ZGU5ZGUzN2M5MDdkZDQwMmVmZjhhZTc3YjNmYzk5NTcwNTQ3OGY=
13
+ NDdhNjQyYTUwYjQ3YWY4OGZkYjdmODE4NGU2MTJkZGNlYjhhNGZkNmU1NjQ5
14
+ MGFkZTdjOTU5NGQwODc5YzFhMjQzOTg0NDVkYTg4ZTE0ODBlOGYzODRiMDdj
15
+ ZmU1MGZlNWYzMzg1MDg4OTdkNWFiODc4NjE1YjVhMWZhNWRjOTI=
@@ -0,0 +1,29 @@
1
+ require 'ostruct'
2
+
3
+ module NerdLog
4
+ class Encounter
5
+ attr_reader :http_connection
6
+ def initialize(options = {})
7
+ @http_connection = options.fetch(:http_connection, NerdLog.configuration.http_connection)
8
+ end
9
+
10
+ def encounters
11
+ encounters = []
12
+
13
+ fetch.body.each do |zone|
14
+ zone['encounters'].each do |encounter|
15
+ encounters << OpenStruct.new(zone_id: zone['id'],
16
+ id: encounter['id'],
17
+ name: encounter['name'])
18
+ end
19
+ end
20
+ encounters
21
+ end
22
+
23
+ def fetch
24
+ response = http_connection.get("zones")
25
+
26
+ response
27
+ end
28
+ end
29
+ end
@@ -1,3 +1,3 @@
1
1
  module NerdLog
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/nerd_log.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "nerd_log/version"
2
2
  require "nerd_log/report"
3
+ require "nerd_log/encounter"
3
4
  require "faraday_middleware"
4
5
 
5
6
  module NerdLog
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nerd_log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Robertson
@@ -79,6 +79,7 @@ files:
79
79
  - README.md
80
80
  - Rakefile
81
81
  - lib/nerd_log.rb
82
+ - lib/nerd_log/encounter.rb
82
83
  - lib/nerd_log/report.rb
83
84
  - lib/nerd_log/version.rb
84
85
  - nerd_log.gemspec