Class: Complicode::Invoice
- Inherits:
-
Object
- Object
- Complicode::Invoice
- Defined in:
- lib/complicode/invoice.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#issue_date ⇒ Object
readonly
Returns the value of attribute issue_date.
-
#nit ⇒ Object
readonly
Returns the value of attribute nit.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
-
#initialize(nit:, number:, issue_date:, amount:) ⇒ Invoice
constructor
A new instance of Invoice.
Constructor Details
#initialize(nit:, number:, issue_date:, amount:) ⇒ Invoice
Returns a new instance of Invoice.
11 12 13 14 15 16 |
# File 'lib/complicode/invoice.rb', line 11 def initialize(nit:, number:, issue_date:, amount:) @amount = Float(amount) @nit = Integer(nit) @number = Integer(number) @issue_date = Date.parse(issue_date.to_s) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
5 6 7 |
# File 'lib/complicode/invoice.rb', line 5 def amount @amount end |
#issue_date ⇒ Object (readonly)
Returns the value of attribute issue_date.
5 6 7 |
# File 'lib/complicode/invoice.rb', line 5 def issue_date @issue_date end |
#nit ⇒ Object (readonly)
Returns the value of attribute nit.
5 6 7 |
# File 'lib/complicode/invoice.rb', line 5 def nit @nit end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
5 6 7 |
# File 'lib/complicode/invoice.rb', line 5 def number @number end |