jbr 3.5.0 → 3.5.1

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: 0f0002106d5864e3b0224d1a454f67813be100c2fca6abd411417f81ac913e53
4
- data.tar.gz: 1e7998f2402eea55768b060ddc4057a7d513c29741b419fa5ade852caaf71a7a
3
+ metadata.gz: f5c1536ff754171e5bafc8e5501088b0372c673c98e3891786b43da0a69f5c75
4
+ data.tar.gz: 61bf56b9de47ec4ada6e406967c36240a95351d50a007730ce2506c0d7244864
5
5
  SHA512:
6
- metadata.gz: 6b7ce3628d2828f50173f6e41bccf9e6cb3dd2c9197dc7bcf0b30e814f49e5e27db25641835e0b8c174cd9c6e6e96daae74b16c3f532e67cf7fb6b45f466035c
7
- data.tar.gz: 1cf960b5042097b943e62dd9ced8ab0e4adf0a084f8ca6143ea48b38c9e2510fae13b21d0576c9165916af7a85d587726d6ed34875c34a32bbe019c83632f662
6
+ metadata.gz: 52d0070f75aa56d58874e301c0bb11b8b78fb108ac2327617094f9ee3676302fb8b59dee89942203dc993305356a43165b0fb053ac0257f1cb0f1299949ad5b3
7
+ data.tar.gz: 73c45d7ed55f796c7e0068eb19c33bc07e0a1ac2359a594b12eca096b43e8bf86058e4f67b3f03877d02e337a87ee81be3efca500df6deb6b9470a175065bdbc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [3.5.1] - 2026-08-17
2
+
3
+ - [Change] A line item is how many of what, and nothing else. `description` was answered and
4
+ read out in `to_s` alongside the quantity and the name, and no caller ever wanted it — so it
5
+ is not asked of Jobber any more, which is a smaller query as well as a smaller class.
6
+ `quantified` goes with it: it existed only to be the half of `to_s` without a description,
7
+ and `to_s` is that on its own now. A job's summary is `line_items.to_sentence`, since
8
+ `to_sentence` reads each line's own string form
9
+
1
10
  ## [3.5.0] - 2026-08-17
2
11
 
3
12
  - [Fix] A walk of jobs carrying their line items was refused outright: `Throttled`. Jobber
data/README.md CHANGED
@@ -119,11 +119,9 @@ job.line_items # => an Array of the lines the job is made of
119
119
  line = job.line_items.first
120
120
  line.quantity # => 3, whole where Jobber's own Float has nothing after the point, and 3.5
121
121
  # where it has: `3 Faucets`, or `3.5 Hours` for what was really billed
122
- line.quantified # => '3 Bathroom Faucet Installation', how many of what
123
122
  line.name # => 'Bathroom Faucet Installation'
124
- line.description # => 'Professional installation of a new bathroom faucet'
125
- line.to_s # => '3 Bathroom Faucet Installation (Professional installation of a new bathroom
126
- # faucet)', and without the parenthesis where nobody described it
123
+ line.to_s # => '3 Bathroom Faucet Installation', how many of what, and the name alone where
124
+ # Jobber holds no quantity for the line
127
125
  ```
128
126
 
129
127
  Every line Jobber holds is in the list, up to twenty of them, in the order it holds them and
data/lib/jbr/job.rb CHANGED
@@ -10,11 +10,11 @@ module Jbr
10
10
  def instructions = @node['instructions']
11
11
 
12
12
  # What the job's lines add up to, each as how many of what: `3 Faucet install and 2 Valve
13
- # change`. The lines say what the work was where a title only says what it was called, so
14
- # this reads better than one and falls back to {#name} where the job has no lines, or
15
- # where the query never asked for them. Never nil and never empty.
16
- # @return [String] the lines as a sentence, or the title, or the ID.
17
- def summary = line_items.map(&:quantified).to_sentence.presence || name
13
+ # change` `to_sentence` reading each line's own string form. The lines say what the work
14
+ # was where a title only says what it was called, so this reads better than one, and falls
15
+ # back to {#name} where the job has no lines or the query never asked for them.
16
+ # @return [String] the lines as a sentence, or the title, or the ID. Never nil, never empty.
17
+ def summary = line_items.to_sentence.presence || name
18
18
 
19
19
  # @return [String, nil] where Jobber files the job in its own workflow.
20
20
  def status = @node['jobStatus']
data/lib/jbr/line_item.rb CHANGED
@@ -1,9 +1,8 @@
1
1
  module Jbr
2
- # One line of the work a job is made of: how many of a thing, what it is called, and what
3
- # doing it involves.
2
+ # One line of the work a job is made of: how many of a thing, and what it is called.
4
3
  class LineItem < Resource
5
4
  # What Jobber calls each field of a line.
6
- FIELDS = %w[quantity name description]
5
+ FIELDS = %w[quantity name]
7
6
 
8
7
  # The most lines to read off one record. Bounded because Jobber prices a connection by the
9
8
  # page it is asked for and prices an unbounded one at its own maximum, so the lines of a
@@ -23,16 +22,9 @@ module Jbr
23
22
  # @return [String, nil] what the line is called.
24
23
  def name = @node['name']
25
24
 
26
- # @return [String, nil] what doing it involves, in whoever wrote the line's own words.
27
- def description = @node['description']
28
-
29
25
  # @return [String] how many of what: `3 Bathroom Faucet Installation`, and the name alone
30
26
  # where Jobber holds no quantity for the line.
31
- def quantified = [ quantity, name ].compact.join ' '
32
-
33
- # @return [String] how a line reads: `3 Faucet install (Fits a new faucet)`, and without
34
- # the parenthesis where nobody described it.
35
- def to_s = [ quantified, described ].compact.join ' '
27
+ def to_s = [ quantity, name ].compact.join ' '
36
28
 
37
29
  private
38
30
 
@@ -40,7 +32,5 @@ module Jbr
40
32
  # `3 Faucets` rather than `3.0 Faucets`. A fraction keeps its point — `3.5 Faucets` —
41
33
  # since rounding it would lie about what was billed.
42
34
  def whole(number) = number && ((number % 1).zero? ? number.to_i : number)
43
-
44
- def described = ("(#{description})" if description.present?)
45
35
  end
46
36
  end
@@ -6,7 +6,5 @@ module Jbr
6
6
  def quantity = whole @node[:quantity]
7
7
 
8
8
  def name = @node[:name]
9
-
10
- def description = @node[:description]
11
9
  end
12
10
  end
data/lib/jbr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # A Ruby client for the Jobber API.
2
2
  module Jbr
3
3
  # The version of this gem.
4
- VERSION = '3.5.0'
4
+ VERSION = '3.5.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jbr
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo