Class: Angus::SDoc::Definitions::RepresentationField
- Inherits:
-
Object
- Object
- Angus::SDoc::Definitions::RepresentationField
- Defined in:
- lib/angus/definitions/representation_field.rb
Instance Attribute Summary collapse
-
#description ⇒ String
The description of the representation field.
-
#elements_type ⇒ String
The elements type of the representation field.
-
#name ⇒ String
The name of the representation field.
-
#required ⇒ Boolean
Indicates if the representation field is required or not.
-
#type ⇒ String
The type of the representation field.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Check if an object is equals to the current instance.
-
#initialize(name = nil, description = nil, required = nil, type = nil, elements_type = nil) ⇒ RepresentationField
constructor
A new instance of RepresentationField.
Constructor Details
#initialize(name = nil, description = nil, required = nil, type = nil, elements_type = nil) ⇒ RepresentationField
if the elements_type attribute is different from nil, it means that the representation field is a list of objects. In that case, the type parameter is not considered.
Returns a new instance of RepresentationField.
30 31 32 33 34 35 36 |
# File 'lib/angus/definitions/representation_field.rb', line 30 def initialize(name = nil, description = nil, required = nil, type = nil, elements_type = nil) self.name= name self.description= description self.required= required self.type= type self.elements_type= elements_type end |
Instance Attribute Details
#description ⇒ String
Returns the description of the representation field.
11 12 13 |
# File 'lib/angus/definitions/representation_field.rb', line 11 def description @description end |
#elements_type ⇒ String
Returns the elements type of the representation field. This attribute is used when the representation is a list of objects.
25 26 27 |
# File 'lib/angus/definitions/representation_field.rb', line 25 def elements_type @elements_type end |
#name ⇒ String
Returns the name of the representation field.
7 8 9 |
# File 'lib/angus/definitions/representation_field.rb', line 7 def name @name end |
#required ⇒ Boolean
Returns indicates if the representation field is required or not.
15 16 17 |
# File 'lib/angus/definitions/representation_field.rb', line 15 def required @required end |
#type ⇒ String
Returns the type of the representation field. This attribute is used when the representation is a single object.
20 21 22 |
# File 'lib/angus/definitions/representation_field.rb', line 20 def type @type end |
Instance Method Details
#==(other) ⇒ Boolean
Check if an object is equals to the current instance.
43 44 45 46 47 |
# File 'lib/angus/definitions/representation_field.rb', line 43 def == (other) other.kind_of?(Definitions::RepresentationField) && self.name == other.name && self.description == other.description && self.required == other.required && self.type == other.type && self.elements_type == other.elements_type end |