Class: NodeBlock

Inherits:
Object
  • Object
show all
Defined in:
src/ruby/schema_renderer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#labelObject (readonly)

Returns the value of attribute label.



10
11
12
# File 'src/ruby/schema_renderer.rb', line 10

def label
  @label
end

#propertiesObject (readonly)

Returns the value of attribute properties.



11
12
13
# File 'src/ruby/schema_renderer.rb', line 11

def properties
  @properties
end

#relsObject (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