Class: Languages::ClassData
- Defined in:
- lib/kuniri/language/container_data/structured_and_oo/class_data.rb
Overview
Handling class information
Instance Attribute Summary collapse
-
#aggregations ⇒ Object
Returns the value of attribute aggregations.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#constructors ⇒ Object
readonly
Returns the value of attribute constructors.
-
#inheritances ⇒ Object
Returns the value of attribute inheritances.
-
#methods ⇒ Object
readonly
Returns the value of attribute methods.
Attributes inherited from BasicData
Instance Method Summary collapse
-
#add_aggregation(pAggregation) ⇒ Object
Add aggregation inside class.
-
#add_attribute(pAttribute) ⇒ Object
Add attribute to class data, notice the possibility of call this method more than one time.
-
#add_constructor(pConstructor) ⇒ Object
Add constructor inside class.
-
#add_method(pMethod) ⇒ Object
Add method inside ClassData.
-
#initialize ⇒ ClassData
constructor
A new instance of ClassData.
Constructor Details
#initialize ⇒ ClassData
Returns a new instance of ClassData.
20 21 22 23 24 25 26 27 28 |
# File 'lib/kuniri/language/container_data/structured_and_oo/class_data.rb', line 20 def initialize @inheritances = [] @attributes = [] @methods = [] @constructors = [] @aggregations = [] @visibility = "public" @comments = "" end |
Instance Attribute Details
#aggregations ⇒ Object
Returns the value of attribute aggregations.
15 16 17 |
# File 'lib/kuniri/language/container_data/structured_and_oo/class_data.rb', line 15 def aggregations @aggregations end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
16 17 18 |
# File 'lib/kuniri/language/container_data/structured_and_oo/class_data.rb', line 16 def attributes @attributes end |
#constructors ⇒ Object (readonly)
Returns the value of attribute constructors.
18 19 20 |
# File 'lib/kuniri/language/container_data/structured_and_oo/class_data.rb', line 18 def constructors @constructors end |
#inheritances ⇒ Object
Returns the value of attribute inheritances.
14 15 16 |
# File 'lib/kuniri/language/container_data/structured_and_oo/class_data.rb', line 14 def inheritances @inheritances end |
#methods ⇒ Object (readonly)
Returns the value of attribute methods.
17 18 19 |
# File 'lib/kuniri/language/container_data/structured_and_oo/class_data.rb', line 17 def methods @methods end |
Instance Method Details
#add_aggregation(pAggregation) ⇒ Object
Add aggregation inside class.
61 62 63 64 65 |
# File 'lib/kuniri/language/container_data/structured_and_oo/class_data.rb', line 61 def add_aggregation(pAggregation) return nil unless pAggregation.is_a?(Languages::AggregationData) @aggregations.push(pAggregation) end |
#add_attribute(pAttribute) ⇒ Object
Add attribute to class data, notice the possibility of call this method more than one time.
34 35 36 37 38 39 |
# File 'lib/kuniri/language/container_data/structured_and_oo/class_data.rb', line 34 def add_attribute(pAttribute) pAttribute.each do |attributeElement| next unless attributeElement.is_a?(Languages::AttributeData) @attributes.push(attributeElement) end end |
#add_constructor(pConstructor) ⇒ Object
Add constructor inside class.
53 54 55 56 57 |
# File 'lib/kuniri/language/container_data/structured_and_oo/class_data.rb', line 53 def add_constructor(pConstructor) return nil unless pConstructor.is_a?(Languages::ConstructorData) @constructors.push(pConstructor) end |
#add_method(pMethod) ⇒ Object
Add method inside ClassData. Remember the possibility of have zero or any method inside a class.
45 46 47 48 49 |
# File 'lib/kuniri/language/container_data/structured_and_oo/class_data.rb', line 45 def add_method(pMethod) return nil unless pMethod.is_a?(Languages::MethodData) @methods.push(pMethod) end |