Class: ImplementedChain
Overview
This represents a chain that doesn’t contain any theory variables. All the variables have been replaced with intrinsic/real values.
Instance Attribute Summary collapse
-
#mapping ⇒ Object
readonly
Returns the value of attribute mapping.
Instance Method Summary collapse
-
#[](index) ⇒ Object
TODO Note sure how I feel about this direct access.
- #describe(tab = 0) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(nodes, mapping) ⇒ ImplementedChain
constructor
A new instance of ImplementedChain.
- #length ⇒ Object
- #write(tab = 0) ⇒ Object
Constructor Details
#initialize(nodes, mapping) ⇒ ImplementedChain
Returns a new instance of ImplementedChain.
10 11 12 |
# File 'lib/implemented_chain.rb', line 10 def initialize(nodes,mapping) @nodes, @mapping = nodes, mapping end |
Instance Attribute Details
#mapping ⇒ Object (readonly)
Returns the value of attribute mapping.
6 7 8 |
# File 'lib/implemented_chain.rb', line 6 def mapping @mapping end |
Instance Method Details
#[](index) ⇒ Object
TODO Note sure how I feel about this direct access
19 20 21 |
# File 'lib/implemented_chain.rb', line 19 def [](index) return @nodes[index] end |
#describe(tab = 0) ⇒ Object
27 28 29 |
# File 'lib/implemented_chain.rb', line 27 def describe(tab=0) return @nodes.inject('') {|total,x| total += x.describe} end |
#each(&block) ⇒ Object
14 15 16 |
# File 'lib/implemented_chain.rb', line 14 def each(&block) @nodes.each(&block) end |
#length ⇒ Object
23 24 25 |
# File 'lib/implemented_chain.rb', line 23 def length return @nodes.length end |
#write(tab = 0) ⇒ Object
31 32 33 |
# File 'lib/implemented_chain.rb', line 31 def write(tab=0) return @nodes.inject('') {|total,x| total += x.write} end |