lib-bootp 0.2.2 → 0.2.3

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: eb710dd87f50875bd6f3f868d873a9b2ef85b6cfc125441e960c1e4567a8cc2a
4
- data.tar.gz: c55a3f09f58a9e4b5ba5351c88444140a5c4a05285ead08148b24ef3288159f1
3
+ metadata.gz: 35f8b8b8e9cfea345c8c405e4557e6e8a8232c78968d913b6c7c926ba456dbe0
4
+ data.tar.gz: 5c4344e2a22b5543a2a0a870febd49f4da4d03c33f454a79eaa04718b0ecddd9
5
5
  SHA512:
6
- metadata.gz: 9c4405eeba2f1f2317f1175cf3e03f2b247cded440ebe1ba45ba3c411e36d7f3667cd7a2c14518928d764c7afdf7478682572b79b8accdfd66c50f2b8c53186b
7
- data.tar.gz: d26ad19b2f90a8d9b38b2164877862d9916c89e88a31493bab12034da6d292b89fe6cf5a45b5863fd2c2ca72359c9ec7c261998ad6ed8d755faa6616ad699564
6
+ metadata.gz: 55720d5ce4bb5e82d9c9d27adbcb86dcbf0d217679857f6aaf7a607727bc8568dcfdde44a5cfd02738d2f4b270543aced68985830b27a273e0f3f678a72b1780
7
+ data.tar.gz: de807d6fd9da0245e22c7d952e9d949b08471226618a6c473e883328276e23ac48479561d5477b8b125bddcfc98773053d6e48a9bc250900c78c392c5ccbedd4
@@ -1,5 +1,5 @@
1
1
  module Lib
2
2
  module BOOTP
3
- VERSION = '0.2.2'
3
+ VERSION = '0.2.3'
4
4
  end
5
5
  end
data/lib/lib/bootp.rb CHANGED
@@ -173,8 +173,8 @@ module Lib
173
173
  end
174
174
 
175
175
  def self.from_json(json)
176
- json = JSON.parse json
177
- Lib::BOOTP::Packet.new(
176
+ json = json.is_a?(Hash) ? json: JSON.parse(json)
177
+ self.new(
178
178
  op: json['op']['code'].to_i,
179
179
  htype: json['htype']['code'].to_i,
180
180
  hlen: json['hlen'].to_i,
@@ -182,13 +182,13 @@ module Lib
182
182
  xid: json['xid'].to_i,
183
183
  secs: json['secs'].to_i,
184
184
  flags: json['flags'].to_i,
185
- ciaddr: json['ciaddr']['address'],
186
- yiaddr: json['yiaddr']['address'],
187
- siaddr: json['siaddr']['address'],
188
- giaddr: json['giaddr']['address'],
189
- chaddr: json['chaddr'],
190
- sname: json['sname'],
191
- file: json['file']
185
+ ciaddr: json['ciaddr']['address'].to_s,
186
+ yiaddr: json['yiaddr']['address'].to_s,
187
+ siaddr: json['siaddr']['address'].to_s,
188
+ giaddr: json['giaddr']['address'].to_s,
189
+ chaddr: json['chaddr'].to_s,
190
+ sname: json['sname'].to_s,
191
+ file: json['file'].to_s
192
192
  )
193
193
  end
194
194
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lib-bootp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Wojcieszonek