Class: XlsFunction::FormatString::Evaluators::PartsList
- Inherits:
-
Object
- Object
- XlsFunction::FormatString::Evaluators::PartsList
- Defined in:
- lib/xls_function/format_string/evaluators/number_evaluator.rb
Overview
rubocop:enable Metrics/AbcSize
Instance Attribute Summary collapse
-
#parts_with_index ⇒ Object
readonly
Returns the value of attribute parts_with_index.
Instance Method Summary collapse
- #add_parts(part, index, is_num) ⇒ Object
-
#initialize ⇒ PartsList
constructor
A new instance of PartsList.
- #num?(index) ⇒ Boolean
- #size ⇒ Object
Constructor Details
#initialize ⇒ PartsList
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_index ⇒ Object (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
175 176 177 |
# File 'lib/xls_function/format_string/evaluators/number_evaluator.rb', line 175 def num?(index) @num_indexies.include?(index) end |
#size ⇒ Object
179 180 181 |
# File 'lib/xls_function/format_string/evaluators/number_evaluator.rb', line 179 def size parts_with_index.size end |