Class: NodeBlock
- Inherits:
-
Object
- Object
- NodeBlock
- Defined in:
- src/ruby/schema_renderer.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
-
#rels ⇒ Object
readonly
Returns the value of attribute rels.
Instance Method Summary collapse
- #incoming(type, target) ⇒ Object
-
#initialize(label) ⇒ NodeBlock
constructor
A new instance of NodeBlock.
- #int(key) ⇒ Object
- #outgoing(type, target) ⇒ Object
- #string(key) ⇒ Object
Constructor Details
#initialize(label) ⇒ NodeBlock
Returns a new instance of NodeBlock.
4 5 6 7 8 |
# File 'src/ruby/schema_renderer.rb', line 4 def initialize(label) @label = label @properties = [] @rels = [] end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
10 11 12 |
# File 'src/ruby/schema_renderer.rb', line 10 def label @label end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
11 12 13 |
# File 'src/ruby/schema_renderer.rb', line 11 def properties @properties end |
#rels ⇒ Object (readonly)
Returns the value of attribute rels.
12 13 14 |
# File 'src/ruby/schema_renderer.rb', line 12 def rels @rels end |
Instance Method Details
#incoming(type, target) ⇒ Object
22 23 24 |
# File 'src/ruby/schema_renderer.rb', line 22 def incoming(type, target) @rels << {:dir => :in, :type => type, :target => target} end |
#int(key) ⇒ Object
18 19 20 |
# File 'src/ruby/schema_renderer.rb', line 18 def int(key) @properties << {:key => key, :type => :int} end |
#outgoing(type, target) ⇒ Object
26 27 28 |
# File 'src/ruby/schema_renderer.rb', line 26 def outgoing(type, target) @rels << {:dir => :out, :type => type, :target => target} end |
#string(key) ⇒ Object
14 15 16 |
# File 'src/ruby/schema_renderer.rb', line 14 def string(key) @properties << {:key => key, :type => :string} end |