Class: Hcp::LineItem
- Defined in:
- lib/hcp/resources/line_item.rb
Overview
One line of what a job or an estimate option comes to.
Class Method Summary collapse
-
.key ⇒ Object
Housecall Pro answers a job's line items under
datarather than under their own name.
Instance Method Summary collapse
-
#amount ⇒ BigDecimal?
The amount, which Housecall Pro counts in cents.
-
#description ⇒ String?
The description, as Housecall Pro answers it.
-
#kind ⇒ Symbol?
:materials, :labor, or one of the gratuities and discounts.
-
#name ⇒ String?
The name, as Housecall Pro answers it.
- #quantity ⇒ Float, ...
-
#unit_cost ⇒ BigDecimal?
The unit_cost, which Housecall Pro counts in cents.
-
#unit_price ⇒ BigDecimal?
The unit_price, which Housecall Pro counts in cents.
Methods inherited from Resource
amount, attribute, #id, #initialize, timestamp
Constructor Details
This class inherits a constructor from Hcp::Resource
Class Method Details
.key ⇒ Object
Housecall Pro answers a job's line items under data rather than under their own name.
5 |
# File 'lib/hcp/resources/line_item.rb', line 5 def self.key = 'data' |
Instance Method Details
#amount ⇒ BigDecimal?
Returns the amount, which Housecall Pro counts in cents.
15 |
# File 'lib/hcp/resources/line_item.rb', line 15 amount :amount |
#description ⇒ String?
Returns the description, as Housecall Pro answers it.
8 |
# File 'lib/hcp/resources/line_item.rb', line 8 attribute :description |
#kind ⇒ Symbol?
Returns :materials, :labor, or one of the gratuities and discounts.
18 |
# File 'lib/hcp/resources/line_item.rb', line 18 def kind = @node['kind']&.tr(' ', '_')&.to_sym |
#name ⇒ String?
Returns the name, as Housecall Pro answers it.
7 |
# File 'lib/hcp/resources/line_item.rb', line 7 attribute :name |
#quantity ⇒ Float, ...
11 |
# File 'lib/hcp/resources/line_item.rb', line 11 attribute :quantity |
#unit_cost ⇒ BigDecimal?
Returns the unit_cost, which Housecall Pro counts in cents.
14 |
# File 'lib/hcp/resources/line_item.rb', line 14 amount :unit_cost |
#unit_price ⇒ BigDecimal?
Returns the unit_price, which Housecall Pro counts in cents.
13 |
# File 'lib/hcp/resources/line_item.rb', line 13 amount :unit_price |