Module: IronCalc::DefinedNames

Included in:
Model, UserModel
Defined in:
lib/ironcalc/model.rb

Overview

Prepended to Model and UserModel, so these helpers count as part of the class surface.

Instance Method Summary collapse

Instance Method Details

#defined_names ⇒ Array<Hash>

Same as get_defined_name_list: defined names as an Array of Hashes with Symbol keys:

[{ name: "_key", scope: nil, formula: "Sheet1!$C$1" }, ...]

Returns:

  • (Array<Hash>)


13
14
15
# File 'lib/ironcalc/model.rb', line 13

def defined_names
  get_defined_name_list
end

#valid_defined_name?(name, scope, formula) ⇒ Boolean

Whether #new_defined_name would succeed for these arguments: the boolean form of is_valid_defined_name, which raises with the reason instead.

Parameters:

  • name (String)
  • scope (Integer, nil) —

    0-based sheet index, or nil for workbook scope

  • formula (String)

Returns:

  • (Boolean)


24
25
26
27
28
29
# File 'lib/ironcalc/model.rb', line 24

def valid_defined_name?(name, scope, formula)
  is_valid_defined_name(name, scope, formula)
  true
rescue Error
  false
end