Class: Twb::JoinTable
- Inherits:
-
Object
- Object
- Twb::JoinTable
- Includes:
- Comparable
- Defined in:
- lib/twb/datasource.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#datasource ⇒ Object
readonly
, :str.
-
#depth ⇒ Object
Returns the value of attribute depth.
-
#name ⇒ Object
readonly
, :str.
Instance Method Summary collapse
- #<=>(anOther) ⇒ Object
- #addChild(child) ⇒ Object
- #child(name) ⇒ Object
-
#initialize(name, datasource = nil) ⇒ JoinTable
constructor
A new instance of JoinTable.
- #to_s ⇒ Object
Constructor Details
#initialize(name, datasource = nil) ⇒ JoinTable
Returns a new instance of JoinTable.
612 613 614 615 616 617 618 |
# File 'lib/twb/datasource.rb', line 612 def initialize(name, datasource=nil) @name = name @datasource = datasource # @str = nil @children = {} @depth = 0 end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
610 611 612 |
# File 'lib/twb/datasource.rb', line 610 def children @children end |
#datasource ⇒ Object (readonly)
, :str
609 610 611 |
# File 'lib/twb/datasource.rb', line 609 def datasource @datasource end |
#depth ⇒ Object
Returns the value of attribute depth.
610 611 612 |
# File 'lib/twb/datasource.rb', line 610 def depth @depth end |
#name ⇒ Object (readonly)
, :str
609 610 611 |
# File 'lib/twb/datasource.rb', line 609 def name @name end |
Instance Method Details
#<=>(anOther) ⇒ Object
626 627 628 |
# File 'lib/twb/datasource.rb', line 626 def <=>(anOther) @str <=> anOther.str end |
#addChild(child) ⇒ Object
630 631 632 633 634 635 |
# File 'lib/twb/datasource.rb', line 630 def addChild child # puts "#{@name}.addChild(#{child.name})" # puts "children: #{@children}" @children[child.name] = child if @children[child.name].nil? # puts "children: #{@children}" end |
#child(name) ⇒ Object
637 638 639 |
# File 'lib/twb/datasource.rb', line 637 def child name @children[name] end |
#to_s ⇒ Object
620 621 622 623 624 |
# File 'lib/twb/datasource.rb', line 620 def to_s str = "[#{@datasource}].[#{@name}] :: (#{@depth}) :: #{@children.length} :: " @children.each { |n,c| str << "#{n}, " } return str end |