Class: Financial::Revenue
- Inherits:
-
Object
- Object
- Financial::Revenue
- Defined in:
- lib/financial/revenue.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#method_name ⇒ Object
Returns the value of attribute method_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #format_value ⇒ Object
- #in_date(date) ⇒ Object
-
#initialize(*args) ⇒ Revenue
constructor
A new instance of Revenue.
- #is_a_received_deposit?(account) ⇒ Boolean
- #tax(*args) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Revenue
Returns a new instance of Revenue.
4 5 6 7 8 9 10 |
# File 'lib/financial/revenue.rb', line 4 def initialize(*args) args.flatten! @method_name = args.shift @name = @method_name.to_s.split('_').join(' ').capitalize @value = args.shift @date = Date.today end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
3 4 5 |
# File 'lib/financial/revenue.rb', line 3 def date @date end |
#method_name ⇒ Object
Returns the value of attribute method_name.
3 4 5 |
# File 'lib/financial/revenue.rb', line 3 def method_name @method_name end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/financial/revenue.rb', line 3 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/financial/revenue.rb', line 3 def value @value end |
Instance Method Details
#format_value ⇒ Object
22 23 24 |
# File 'lib/financial/revenue.rb', line 22 def format_value "+ #{Financial.locale.format_coin(value)}" end |
#in_date(date) ⇒ Object
17 18 19 20 |
# File 'lib/financial/revenue.rb', line 17 def in_date(date) @date = Financial::FinancialDate.new(date).date self end |
#is_a_received_deposit?(account) ⇒ Boolean
26 27 28 |
# File 'lib/financial/revenue.rb', line 26 def is_a_received_deposit?(account) false end |