Class: XlsFunction::FormatString::Evaluators::PartsList

Inherits:
Object
  • Object
show all
Defined in:
lib/xls_function/format_string/evaluators/number_evaluator.rb

Overview

rubocop:enable Metrics/AbcSize

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePartsList

Returns a new instance of PartsList.



165
166
167
168
# File 'lib/xls_function/format_string/evaluators/number_evaluator.rb', line 165

def initialize
  @parts_with_index = []
  @num_indexies = []
end

Instance Attribute Details

#parts_with_indexObject (readonly)

Returns the value of attribute parts_with_index.



163
164
165
# File 'lib/xls_function/format_string/evaluators/number_evaluator.rb', line 163

def parts_with_index
  @parts_with_index
end

Instance Method Details

#add_parts(part, index, is_num) ⇒ Object



170
171
172
173
# File 'lib/xls_function/format_string/evaluators/number_evaluator.rb', line 170

def add_parts(part, index, is_num)
  @parts_with_index << [part, index]
  @num_indexies << index if is_num
end

#num?(index) ⇒ Boolean

Returns:

  • (Boolean)


175
176
177
# File 'lib/xls_function/format_string/evaluators/number_evaluator.rb', line 175

def num?(index)
  @num_indexies.include?(index)
end

#sizeObject



179
180
181
# File 'lib/xls_function/format_string/evaluators/number_evaluator.rb', line 179

def size
  parts_with_index.size
end