Class: Company::Line
Overview
One line of a document: how many of a thing, what it is called, and what it comes to.
Class Method Summary collapse
-
.attributes ⇒ Object
What every line reads, by the vocabulary's names.
Instance Method Summary collapse
-
#amount ⇒ BigDecimal?
What the line comes to, in dollars.
-
#description ⇒ String?
What the line says beyond what it is called.
-
#name ⇒ String?
What the line is called.
-
#quantity ⇒ Integer, ...
A whole quantity reads as an Integer --
3 Faucetsrather than3.0 Faucets-- and a fraction keeps its point, since rounding it would lie about what was billed.
Methods inherited from Resource
#id, #initialize, keys, node_keys
Constructor Details
This class inherits a constructor from Company::Resource
Class Method Details
.attributes ⇒ Object
What every line reads, by the vocabulary's names.
5 |
# File 'lib/company/resources/line.rb', line 5 def self.attributes = %i[id name description quantity amount] |
Instance Method Details
#amount ⇒ BigDecimal?
Returns what the line comes to, in dollars.
19 |
# File 'lib/company/resources/line.rb', line 19 def amount = decimal :amount |
#description ⇒ String?
Returns what the line says beyond what it is called.
11 |
# File 'lib/company/resources/line.rb', line 11 def description = attribute :description |
#name ⇒ String?
Returns what the line is called.
8 |
# File 'lib/company/resources/line.rb', line 8 def name = attribute :name |
#quantity ⇒ Integer, ...
A whole quantity reads as an Integer -- 3 Faucets rather than 3.0 Faucets -- and a
fraction keeps its point, since rounding it would lie about what was billed.
16 |
# File 'lib/company/resources/line.rb', line 16 def quantity = whole attribute(:quantity) |