Class: QuickETL::Money
- Inherits:
-
QuickETLObject
- Object
- QuickETLObject
- QuickETL::Money
- Defined in:
- lib/quick_etl_money.rb
Instance Attribute Summary collapse
-
#numeric_value ⇒ Object
Returns the value of attribute numeric_value.
-
#string_value ⇒ Object
Returns the value of attribute string_value.
Instance Method Summary collapse
-
#initialize(s = '0.00') ⇒ Money
constructor
A new instance of Money.
- #to_s ⇒ Object
Methods included from QuickETLKernel
#command_line_arg, #command_line_array_arg, #command_line_boolean_arg, #default_delimiter, #display_general_info, #display_usage_instructions, #get_array_property, #get_property, #home_dir, #line_value, #load_properties, #parse_qif_files, #project_author, #project_copyright, #project_date, #project_embedded_comment, #project_license, #project_name, #project_version_number, #project_year, #read_as_ascii_lines, #read_lines, #startup, #strip_lines, #tokenize, #usage_instructions, #write_file, #write_lines
Constructor Details
#initialize(s = '0.00') ⇒ Money
Returns a new instance of Money.
20 21 22 23 24 |
# File 'lib/quick_etl_money.rb', line 20 def initialize(s='0.00') s ? @string_value = s : @string_value = '0.00' @string_value.strip! @numeric_value = numeric(@string_value).to_f end |
Instance Attribute Details
#numeric_value ⇒ Object
Returns the value of attribute numeric_value.
18 19 20 |
# File 'lib/quick_etl_money.rb', line 18 def numeric_value @numeric_value end |
#string_value ⇒ Object
Returns the value of attribute string_value.
18 19 20 |
# File 'lib/quick_etl_money.rb', line 18 def string_value @string_value end |
Instance Method Details
#to_s ⇒ Object
26 27 28 |
# File 'lib/quick_etl_money.rb', line 26 def to_s "#{@numeric_value}" end |