Module: MiniKraken::Core::Entry
- Included in:
- LogVar, Rela::DefRelation
- Defined in:
- lib/mini_kraken/core/entry.rb
Overview
Mix-in module that implements the expected common behaviour of entries placed in the symbol table.
Instance Attribute Summary collapse
-
#name ⇒ String
(also: #label)
readonly
User-defined name of the entry.
-
#suffix ⇒ String
Suffix for building the internal name of the entry.
Instance Method Summary collapse
-
#i_name ⇒ String
Return the internal name of the entry Internal names used to disambiguate entry names.
-
#init_name(aName) ⇒ Object
Initialize the entry with given name.
Instance Attribute Details
#name ⇒ String (readonly) Also known as: label
Returns User-defined name of the entry.
9 10 11 |
# File 'lib/mini_kraken/core/entry.rb', line 9 def name @name end |
#suffix ⇒ String
Returns Suffix for building the internal name of the entry.
12 13 14 |
# File 'lib/mini_kraken/core/entry.rb', line 12 def suffix @suffix end |
Instance Method Details
#i_name ⇒ String
Return the internal name of the entry Internal names used to disambiguate entry names. There might be homonyns between variable because:
- A child Scope may have a entry with same name as one of its
ancestor(s).
- Multiple calls to same defrel or procedure may imply multiple creation
of a entry given name...
31 32 33 34 35 36 37 |
# File 'lib/mini_kraken/core/entry.rb', line 31 def i_name if suffix =~ /^_/ label + suffix else (suffix.nil? || suffix.empty?) ? label : suffix end end |
#init_name(aName) ⇒ Object
Initialize the entry with given name
18 19 20 21 |
# File 'lib/mini_kraken/core/entry.rb', line 18 def init_name(aName) @name = aName.dup @name.freeze end |