sw_info 1.0.4 → 1.0.8
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 +4 -4
- data/lib/sw_info.rb +2 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ca4b798f74c5abdaf6ff658f5e1e82b1a49aa801925a85911f18a0478b92138
|
4
|
+
data.tar.gz: 2419a953ddfb997f3503af35d9f410d849f06974388200045e8af4b1379bcd73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82af48bd0443359a2a45925c049466ec80e25d1df7ce71145848b7e3fcc0e7183a05d3a5bdf513f203a7df496c658f6451c3fc7343c38501e3b2459176c3c878
|
7
|
+
data.tar.gz: 6a16b4f36092b50ff60be861c3d2cffb4baa2e4a087b504cdb7ba03eb546fd3a8feec5a7fb786affed57d17120e8e9215f513227da021edd2811703e0c0f8254
|
data/lib/sw_info.rb
CHANGED
@@ -12,9 +12,6 @@ require 'debug'
|
|
12
12
|
# https://github.com/ruby/debug
|
13
13
|
|
14
14
|
# Cargo toda la data de swapi en la variable JSONDATA como hash
|
15
|
-
# JSONDATA = JSON.load_file('./swapi.json').each_with_object({}) do |(key, value), hash|
|
16
|
-
# hash[key] = value
|
17
|
-
# end
|
18
15
|
|
19
16
|
JSONDATA = File.expand_path('swapi.json', __dir__)
|
20
17
|
|
@@ -24,8 +21,7 @@ class Pal
|
|
24
21
|
attr_accessor :data
|
25
22
|
|
26
23
|
def to_s
|
27
|
-
|
28
|
-
name
|
24
|
+
@data.map{ |k, v| "#{k}: #{v}"}.join(', ') + "\n"
|
29
25
|
end
|
30
26
|
|
31
27
|
def id
|
@@ -190,6 +186,4 @@ class Vehicle < Pal
|
|
190
186
|
def vehicle_class
|
191
187
|
@data['vehicle_class']
|
192
188
|
end
|
193
|
-
end
|
194
|
-
|
195
|
-
puts Person.search_for_id('people', 1).to_json
|
189
|
+
end
|