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 +8 -8
- data/lib/nerd_log/encounter.rb +29 -0
- data/lib/nerd_log/version.rb +1 -1
- data/lib/nerd_log.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MWVhMDBkZjNkOTIyOTBkNzA3Njc3NGM0YTk5YzUwNTc4ZWNmMzNmNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzY5YjkzOTI2MWJjM2NmNmM4NzY5YzY1YzhiOWRjYmM3OWVhNDNkZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDcxZWJkNmM3Y2Q1Njg1MjhiMzEyZTUyNTU5ZTdkODc3ZTY3Y2NjYmQxZGJj
|
10
|
+
ZjE1YWI1ZjUxMTg0Mjg3NTNmOTVjNDNmOGRlM2YwZTg4NDVjOGIxODcxNmI1
|
11
|
+
OGY1MTA0ODBkOWVlY2ZjYjFlYWUzODVlYzA2ZDAzZjBkZTU1MmU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
data/lib/nerd_log/version.rb
CHANGED
data/lib/nerd_log.rb
CHANGED
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.
|
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
|