Class: Complicode::Invoice

Inherits:
Object
  • Object
show all
Defined in:
lib/complicode/invoice.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nit:, number:, issue_date:, amount:) ⇒ Invoice

Returns a new instance of Invoice.

Parameters:

  • :nit (Integer)
  • :number (Integer)
  • :amount (Float)
  • :issue_date (Date)


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

#amountObject (readonly)

Returns the value of attribute amount.



5
6
7
# File 'lib/complicode/invoice.rb', line 5

def amount
  @amount
end

#issue_dateObject (readonly)

Returns the value of attribute issue_date.



5
6
7
# File 'lib/complicode/invoice.rb', line 5

def issue_date
  @issue_date
end

#nitObject (readonly)

Returns the value of attribute nit.



5
6
7
# File 'lib/complicode/invoice.rb', line 5

def nit
  @nit
end

#numberObject (readonly)

Returns the value of attribute number.



5
6
7
# File 'lib/complicode/invoice.rb', line 5

def number
  @number
end