Class: Dogviz::Thing
- Inherits:
-
Object
- Object
- Dogviz::Thing
- Defined in:
- lib/dogviz/thing.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#edge_heads ⇒ Object
readonly
Returns the value of attribute edge_heads.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#pointers ⇒ Object
readonly
Returns the value of attribute pointers.
Instance Method Summary collapse
-
#initialize(parent, name, options = {}) ⇒ Thing
constructor
A new instance of Thing.
- #points_to(other, options = {}) ⇒ Object (also: #to)
- #points_to_all(*others) ⇒ Object (also: #to_all)
- #render(renderer) ⇒ Object
- #render_edges(renderer) ⇒ Object
Methods included from Flowable
#does, #method_missing, #note, #receives, #request_handlers, #requests, #start_flow, #stop_flow
Methods included from Nominator
Methods included from Common
#ancestors, #create_id, #doclink, #in_rollup?, #in_skip?, #info, #inherited_render_options, #label_with_info, #on_top_rollup?, #rollup!, #rollup?, #root, #setup_render_attributes, #skip!, #skip?, #under_rollup?, #under_skip?
Constructor Details
#initialize(parent, name, options = {}) ⇒ Thing
Returns a new instance of Thing.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/dogviz/thing.rb', line 16 def initialize(parent, name, = {}) @parent = parent @name = name @id = create_id(name, parent) @pointers = [] @rollup = false @skip = false @info = {} @edge_heads = [] rollup! if [:rollup] .delete(:rollup) @render_options = setup_render_attributes({label: name}.merge ) parent.register name, self end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Dogviz::Flowable
Instance Attribute Details
#edge_heads ⇒ Object (readonly)
Returns the value of attribute edge_heads.
12 13 14 |
# File 'lib/dogviz/thing.rb', line 12 def edge_heads @edge_heads end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/dogviz/thing.rb', line 12 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/dogviz/thing.rb', line 12 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
11 12 13 |
# File 'lib/dogviz/thing.rb', line 11 def parent @parent end |
#pointers ⇒ Object (readonly)
Returns the value of attribute pointers.
12 13 14 |
# File 'lib/dogviz/thing.rb', line 12 def pointers @pointers end |
Instance Method Details
#points_to(other, options = {}) ⇒ Object Also known as: to
41 42 43 44 |
# File 'lib/dogviz/thing.rb', line 41 def points_to(other, = {}) setup_render_edge(other, ) other end |
#points_to_all(*others) ⇒ Object Also known as: to_all
35 36 37 38 39 |
# File 'lib/dogviz/thing.rb', line 35 def points_to_all(*others) others.each { |other| points_to other } end |
#render(renderer) ⇒ Object
49 50 51 |
# File 'lib/dogviz/thing.rb', line 49 def render(renderer) do_render_node(renderer) unless in_rollup? || in_skip? end |
#render_edges(renderer) ⇒ Object
53 54 55 56 57 |
# File 'lib/dogviz/thing.rb', line 53 def render_edges(renderer) pointers.each { |p| render_pointer p, renderer } end |