Class: QuickETL::Money

Inherits:
QuickETLObject show all
Defined in:
lib/quick_etl_money.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_valueObject

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_valueObject

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_sObject



26
27
28
# File 'lib/quick_etl_money.rb', line 26

def to_s
  "#{@numeric_value}"
end