Class: MiniKraken::Core::AssociationCopy
- Inherits:
-
Association
- Object
- Association
- MiniKraken::Core::AssociationCopy
- Defined in:
- lib/mini_kraken/core/association_copy.rb
Overview
A specialized association that bind a variable to a value from another association.
Instance Attribute Summary collapse
-
#i_name ⇒ String
Internal name of variable being associated the value.
-
#source ⇒ Association
readonly
The association from which the value is shared.
Instance Method Summary collapse
-
#dependencies(ctx) ⇒ Array<String>
The i_names of direct dependent variables.
-
#floating?(ctx) ⇒ Boolean
Is the associated value floating, that is, it does contain a variable that is either unbound or floating?.
-
#initialize(aVariable, anAssoc) ⇒ AssociationCopy
constructor
A new instance of AssociationCopy.
-
#pinned?(ctx) ⇒ Boolean
Is the associated value pinned, that is, doesn’t contain an unbound or floating variable?.
-
#value ⇒ Term
The MiniKraken value associated with the variable.
Constructor Details
#initialize(aVariable, anAssoc) ⇒ AssociationCopy
Returns a new instance of AssociationCopy.
18 19 20 21 |
# File 'lib/mini_kraken/core/association_copy.rb', line 18 def initialize(aVariable, anAssoc) super(aVariable, nil) @source = anAssoc end |
Instance Attribute Details
#i_name ⇒ String
Returns internal name of variable being associated the value.
11 12 13 |
# File 'lib/mini_kraken/core/association_copy.rb', line 11 def i_name @i_name end |
#source ⇒ Association (readonly)
Returns the association from which the value is shared.
14 15 16 |
# File 'lib/mini_kraken/core/association_copy.rb', line 14 def source @source end |
Instance Method Details
#dependencies(ctx) ⇒ Array<String>
Returns The i_names of direct dependent variables.
45 46 47 |
# File 'lib/mini_kraken/core/association_copy.rb', line 45 def dependencies(ctx) source.dependencies(ctx) end |
#floating?(ctx) ⇒ Boolean
Is the associated value floating, that is, it does contain a variable that is either unbound or floating?
27 28 29 |
# File 'lib/mini_kraken/core/association_copy.rb', line 27 def floating?(ctx) source.floating?(ctx) end |
#pinned?(ctx) ⇒ Boolean
Is the associated value pinned, that is, doesn’t contain an unbound or floating variable?
35 36 37 |
# File 'lib/mini_kraken/core/association_copy.rb', line 35 def pinned?(ctx) source.pinned?(ctx) end |
#value ⇒ Term
Returns the MiniKraken value associated with the variable.
40 41 42 |
# File 'lib/mini_kraken/core/association_copy.rb', line 40 def value source.value end |