Class: RubyToUML::UMLInfoGenerator::UMLInfo
- Inherits:
-
Object
- Object
- RubyToUML::UMLInfoGenerator::UMLInfo
- Defined in:
- lib/ruby_to_uml/uml_info_generator/info_classes.rb
Instance Attribute Summary collapse
-
#classes ⇒ Object
readonly
Returns the value of attribute classes.
-
#modules ⇒ Object
readonly
Returns the value of attribute modules.
-
#relationships ⇒ Object
readonly
Returns the value of attribute relationships.
Instance Method Summary collapse
- #class_instance_methods ⇒ Object
- #class_instance_variables ⇒ Object
- #class_names ⇒ Object
- #class_singleton_methods ⇒ Object
-
#initialize(classes, modules, relationships) ⇒ UMLInfo
constructor
A new instance of UMLInfo.
- #merge(other_uml_info) ⇒ Object
- #module_instance_methods ⇒ Object
- #module_names ⇒ Object
- #module_singleton_methods ⇒ Object
- #relationship_descriptions ⇒ Object
Constructor Details
#initialize(classes, modules, relationships) ⇒ UMLInfo
Returns a new instance of UMLInfo.
37 38 39 40 41 |
# File 'lib/ruby_to_uml/uml_info_generator/info_classes.rb', line 37 def initialize(classes, modules, relationships) @classes = classes @modules = modules @relationships = relationships end |
Instance Attribute Details
#classes ⇒ Object (readonly)
Returns the value of attribute classes.
35 36 37 |
# File 'lib/ruby_to_uml/uml_info_generator/info_classes.rb', line 35 def classes @classes end |
#modules ⇒ Object (readonly)
Returns the value of attribute modules.
35 36 37 |
# File 'lib/ruby_to_uml/uml_info_generator/info_classes.rb', line 35 def modules @modules end |
#relationships ⇒ Object (readonly)
Returns the value of attribute relationships.
35 36 37 |
# File 'lib/ruby_to_uml/uml_info_generator/info_classes.rb', line 35 def relationships @relationships end |
Instance Method Details
#class_instance_methods ⇒ Object
51 52 53 |
# File 'lib/ruby_to_uml/uml_info_generator/info_classes.rb', line 51 def class_instance_methods classes.map { |class_info| class_info.instance_methods_info.map(&:to_s).join("\n") } end |
#class_instance_variables ⇒ Object
67 68 69 |
# File 'lib/ruby_to_uml/uml_info_generator/info_classes.rb', line 67 def class_instance_variables classes.map(&:instance_variables_info) end |
#class_names ⇒ Object
43 44 45 |
# File 'lib/ruby_to_uml/uml_info_generator/info_classes.rb', line 43 def class_names classes.map(&:name) end |
#class_singleton_methods ⇒ Object
59 60 61 |
# File 'lib/ruby_to_uml/uml_info_generator/info_classes.rb', line 59 def class_singleton_methods classes.map { |class_info| class_info.singleton_methods_info.map(&:to_s).join("\n") } end |
#merge(other_uml_info) ⇒ Object
75 76 77 78 79 80 |
# File 'lib/ruby_to_uml/uml_info_generator/info_classes.rb', line 75 def merge(other_uml_info) unique_relationships = (relationships + other_uml_info.relationships).uniq unique_classes = merge_classes(classes, other_uml_info.classes) unique_modules = merge_modules(modules, other_uml_info.modules) UMLInfo.new(unique_classes, unique_modules, unique_relationships) end |
#module_instance_methods ⇒ Object
55 56 57 |
# File 'lib/ruby_to_uml/uml_info_generator/info_classes.rb', line 55 def module_instance_methods modules.map { |class_info| class_info.instance_methods_info.map(&:to_s).join("\n") } end |
#module_names ⇒ Object
47 48 49 |
# File 'lib/ruby_to_uml/uml_info_generator/info_classes.rb', line 47 def module_names modules.map(&:name) end |
#module_singleton_methods ⇒ Object
63 64 65 |
# File 'lib/ruby_to_uml/uml_info_generator/info_classes.rb', line 63 def module_singleton_methods modules.map { |class_info| class_info.singleton_methods_info.map(&:to_s).join("\n") } end |
#relationship_descriptions ⇒ Object
71 72 73 |
# File 'lib/ruby_to_uml/uml_info_generator/info_classes.rb', line 71 def relationship_descriptions relationships.map(&:to_s) end |