Class: HG::Node
- Inherits:
-
Object
- Object
- HG::Node
- Defined in:
- lib/zipf/hypergraph.rb
Instance Attribute Summary collapse
-
#cat ⇒ Object
Returns the value of attribute cat.
-
#incoming ⇒ Object
Returns the value of attribute incoming.
-
#label ⇒ Object
Returns the value of attribute label.
-
#outgoing ⇒ Object
Returns the value of attribute outgoing.
-
#score ⇒ Object
Returns the value of attribute score.
Instance Method Summary collapse
-
#initialize(label = nil, cat = nil, outgoing = [], incoming = [], score = nil) ⇒ Node
constructor
A new instance of Node.
- #to_s ⇒ Object
Constructor Details
#initialize(label = nil, cat = nil, outgoing = [], incoming = [], score = nil) ⇒ Node
Returns a new instance of Node.
11 12 13 14 15 16 17 |
# File 'lib/zipf/hypergraph.rb', line 11 def initialize label=nil, cat=nil, outgoing=[], incoming=[], score=nil @label = label @cat = cat @outgoing = outgoing @incoming = incoming @score = nil end |
Instance Attribute Details
#cat ⇒ Object
Returns the value of attribute cat.
9 10 11 |
# File 'lib/zipf/hypergraph.rb', line 9 def cat @cat end |
#incoming ⇒ Object
Returns the value of attribute incoming.
9 10 11 |
# File 'lib/zipf/hypergraph.rb', line 9 def incoming @incoming end |
#label ⇒ Object
Returns the value of attribute label.
9 10 11 |
# File 'lib/zipf/hypergraph.rb', line 9 def label @label end |
#outgoing ⇒ Object
Returns the value of attribute outgoing.
9 10 11 |
# File 'lib/zipf/hypergraph.rb', line 9 def outgoing @outgoing end |
#score ⇒ Object
Returns the value of attribute score.
9 10 11 |
# File 'lib/zipf/hypergraph.rb', line 9 def score @score end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/zipf/hypergraph.rb', line 19 def to_s "Node<label:\"#{@label}\", cat:\"#{@cat}\", outgoing:#{@outgoing.size}, incoming:#{@incoming.size}>" end |