hudu 0.3.2 → 0.3.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: d1e4245c0dce3f094901ea8fdfbcf9b4c2d395b702968d5b869e60dad16adfc5
4
- data.tar.gz: 2e44553c6bbac29f51fae2453a55c36b5fdeb26745cabf73c4cb6cfcc97e2eea
3
+ metadata.gz: 101911f730e28e20fcfe50f7677d7656163703bd1cb81b4fad5aebf8ff1b0084
4
+ data.tar.gz: 121eafb2cd99b4d24b0156c4f08065c005dc6bc839f1a805c117f5e7c5a332a2
5
5
  SHA512:
6
- metadata.gz: 9bc275aebd8cb6dbf89be44e4fdd59eb24761ab5d7b63c8687cf480f5ad6a3074dc911850705881e1bc2b173979393b6a0a859c6e13c7077e151d1853c71fe2d
7
- data.tar.gz: c50428e0ec1922c8cc11fc1710ce82d99af88e1ac110c2a559da7b6baeed3c3183b5e8a28087e79e8bc40434baabb3ac9aef90d548b57941ce371152866b1bbd
6
+ metadata.gz: 7ec13aa4eaaf14f114a0043946269a9074e1ea307dce01e1ad15decb857d5b5b72530a87bcb1f9c56b33fe4a9eb2292a72adebd897b9df934b1d62baf2cff6b5
7
+ data.tar.gz: 6ff6828af1e8e7a26366ec4b8341d4cdeb6a57fa33db124aa7bdabf92c347a03787d00abab07b8be22d171311c8ce9aa8d188f3be128d14e315cc24b8cb6013b
data/CHANGELOG.md CHANGED
@@ -19,3 +19,7 @@
19
19
  ## [0.3.2] - 2025-03-20
20
20
 
21
21
  - update wrapi dependency
22
+
23
+ ## [0.3.3] - 2025-09-10
24
+
25
+ - update HUDU API changes page size and asset layout structure
@@ -11,20 +11,20 @@ module Hudu
11
11
  # @example
12
12
  # asset = SomeAssetEntity.new(attributes: { id: 1, name: "Asset 1", company_id: 101 }, fields: [field1, field2])
13
13
  # Hudu::AssetHelper.construct_asset(asset)
14
- # # => { asset:
14
+ # # => { asset:
15
15
  # # { id: 1, company_id: 101, asset_layout_id: nil, slug: nil, name: "Asset 1", custom_fields: [...]
16
16
  # # }
17
17
  # # }
18
18
  def self.construct_asset(asset)
19
19
  custom_asset = asset.attributes.slice(
20
20
  *%w[
21
- id company_id asset_layout_id slug name
21
+ asset_layout_id name
22
22
  primary_serial primary_model primary_mail
23
23
  primary_manufacturer
24
24
  ]
25
25
  )
26
26
  custom_asset['custom_fields'] = custom_fields(asset.fields)
27
- { asset: custom_asset }
27
+ custom_asset
28
28
  end
29
29
 
30
30
  # Creates a new asset from the given layout and fields.
@@ -51,7 +51,7 @@ module Hudu
51
51
  # Formats custom fields into a standardized hash structure.
52
52
  #
53
53
  # @param fields [Array<Object>] A collection of field objects, each expected to respond to `label` and `value`.
54
- # @return [Array<Hash>] An array containing a single hash mapping field labels
54
+ # @return [Array<Hash>] An array containing a single hash mapping field labels
55
55
  # (downcased and underscored) to their values.
56
56
  #
57
57
  # @example
@@ -59,7 +59,7 @@ module Hudu
59
59
  # Hudu::AssetHelper.custom_fields(fields)
60
60
  # # => [{ "warranty" => "2025", "location" => "NYC" }]
61
61
  def self.custom_fields(fields)
62
- [fields.map { |field| [field.label.downcase.gsub(' ', '_'), field.value] }.to_h]
62
+ fields.map { |field| { field.label.downcase.gsub(' ', '_') => field.value.to_s } }
63
63
  end
64
64
  end
65
65
  end
@@ -17,7 +17,7 @@ module Hudu
17
17
 
18
18
  DEFAULT_UA = "Ruby Hudu API wrapper #{Hudu::VERSION}"
19
19
  DEFAULT_PAGINATION = RequestPagination::PagingInfoPager
20
- DEFAULT_PAGE_SIZE = 100
20
+ DEFAULT_PAGE_SIZE = 25
21
21
 
22
22
  # When this module is extended, set all configuration options to their default values
23
23
  def self.extended(base)
data/lib/hudu/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hudu
4
- VERSION = '0.3.2'
4
+ VERSION = '0.3.3'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hudu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janco Tanis
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-20 00:00:00.000000000 Z
10
+ date: 2025-09-10 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: faraday