| Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
|---|---|---|---|---|
| lib/dagnabit/activation.rb | 60 | 23 | 100.00%
|
100.00%
|
Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.
1 module Dagnabit |
2 # |
3 # Class methods for mixing in ("activating") dag functionality. |
4 # |
5 module Activation |
6 # |
7 # Marks an ActiveRecord model as a link model. |
8 # |
9 # == Supported options |
10 # |
11 # [:ancestor_id_column] |
12 # Name of the column in the link tables that will hold the ID of the |
13 # ancestor object. Defaults to +ancestor_id+. |
14 # [:descendant_id_column] |
15 # Name of the column in the link tables that will hold the ID of the |
16 # descendant object. Defaults to +descendant_id+. |
17 # [:transitive_closure_table_name] |
18 # Name of the table that will hold the tuples comprising the transitive |
19 # closure of the dag. Defaults to the edge model's table name affixed by |
20 # "<tt>_transitive_closure_tuples</tt>". |
21 # [:transitive_closure_class_name] |
22 # Name of the generated class that will represent tuples in the transitive |
23 # closure tuple table. This class is created inside the link model class. |
24 # Defaults to +TransitiveClosureLink+. |
25 # |
26 def acts_as_dag_link(options = {}) |
27 extend Dagnabit::Link::Configuration |
28 configure_acts_as_dag_link(options) |
29 |
30 extend Dagnabit::Link::TransitiveClosureLinkModel |
31 generate_transitive_closure_link_model(options) |
32 |
33 extend Dagnabit::Link::ClassMethods |
34 extend Dagnabit::Link::Associations |
35 extend Dagnabit::Link::NamedScopes |
36 extend Dagnabit::Link::Validations |
37 include Dagnabit::Link::CyclePrevention |
38 include Dagnabit::Link::TransitiveClosureRecalculation |
39 end |
40 |
41 # |
42 # Adds convenience methods to dag nodes. |
43 # |
44 # Strictly speaking, it's not necessary to call this method inside classes |
45 # you want to act as nodes. +acts_as_dag_node_linked_by+ merely provides |
46 # convenience methods for finding and traversing links from/to this node. |
47 # |
48 # The +link_class_name+ parameter determines the the link model to be used |
49 # for nodes of this type. |
50 # |
51 def acts_as_dag_node_linked_by(link_class_name) |
52 extend Dagnabit::Node::Configuration |
53 configure_acts_as_dag_node(link_class_name) |
54 |
55 extend Dagnabit::Node::ClassMethods |
56 extend Dagnabit::Node::Associations |
57 include Dagnabit::Node::Neighbors |
58 end |
59 end |
60 end |
Generated on Tue Dec 08 04:06:14 -0600 2009 with rcov 0.9.6