Class: Pomodoro::Formats::Review::Plugins::Expenses::Expense

Inherits:
Object
  • Object
show all
Defined in:
lib/pomodoro/formats/review/plugins/expenses.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(amount:, tip: 0, currency:, description:, payment_method: 'cash', notes: Array.new) ⇒ Expense

Returns a new instance of Expense.


89
90
91
92
# File 'lib/pomodoro/formats/review/plugins/expenses.rb', line 89

def initialize(amount:, tip: 0, currency:, description:, payment_method: 'cash', notes: Array.new)
  @amount, @tip, @currency = amount, tip, currency
  @description, @payment_method, @notes = description, payment_method, notes
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount


88
89
90
# File 'lib/pomodoro/formats/review/plugins/expenses.rb', line 88

def amount
  @amount
end

#currencyObject (readonly)

Returns the value of attribute currency


88
89
90
# File 'lib/pomodoro/formats/review/plugins/expenses.rb', line 88

def currency
  @currency
end

#descriptionObject (readonly)

Returns the value of attribute description


88
89
90
# File 'lib/pomodoro/formats/review/plugins/expenses.rb', line 88

def description
  @description
end

#notesObject (readonly)

Returns the value of attribute notes


88
89
90
# File 'lib/pomodoro/formats/review/plugins/expenses.rb', line 88

def notes
  @notes
end

#payment_methodObject (readonly)

Returns the value of attribute payment_method


88
89
90
# File 'lib/pomodoro/formats/review/plugins/expenses.rb', line 88

def payment_method
  @payment_method
end

#tipObject (readonly)

Returns the value of attribute tip


88
89
90
# File 'lib/pomodoro/formats/review/plugins/expenses.rb', line 88

def tip
  @tip
end

Instance Method Details

#totalObject


94
95
96
# File 'lib/pomodoro/formats/review/plugins/expenses.rb', line 94

def total
  self.amount + self.tip
end