Class: TxtData::TxtDataRowDSL::Field

Inherits:
Struct
  • Object
show all
Includes:
FormatHelpers
Defined in:
lib/txt_data/txt_data_row_dsl/field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FormatHelpers

#filter_illegal_characters, #money_format, #number_format, #text_format

Instance Attribute Details

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



4
5
6
# File 'lib/txt_data/txt_data_row_dsl/field.rb', line 4

def format
  @format
end

#justObject

Returns the value of attribute just

Returns:

  • (Object)

    the current value of just



4
5
6
# File 'lib/txt_data/txt_data_row_dsl/field.rb', line 4

def just
  @just
end

#padObject

Returns the value of attribute pad

Returns:

  • (Object)

    the current value of pad



4
5
6
# File 'lib/txt_data/txt_data_row_dsl/field.rb', line 4

def pad
  @pad
end

#rangeObject

Returns the value of attribute range

Returns:

  • (Object)

    the current value of range



4
5
6
# File 'lib/txt_data/txt_data_row_dsl/field.rb', line 4

def range
  @range
end

#sanitizeObject

Returns the value of attribute sanitize

Returns:

  • (Object)

    the current value of sanitize



4
5
6
# File 'lib/txt_data/txt_data_row_dsl/field.rb', line 4

def sanitize
  @sanitize
end

#symbolObject

Returns the value of attribute symbol

Returns:

  • (Object)

    the current value of symbol



4
5
6
# File 'lib/txt_data/txt_data_row_dsl/field.rb', line 4

def symbol
  @symbol
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



4
5
6
# File 'lib/txt_data/txt_data_row_dsl/field.rb', line 4

def value
  @value
end

Instance Method Details

#to_s(record) ⇒ Object



7
8
9
10
11
# File 'lib/txt_data/txt_data_row_dsl/field.rb', line 7

def to_s(record)
  data = get_data(record)
  validate_length!(data)
  format_data data
end