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.
-
#optional ⇒ Boolean
True if the element is optional.
-
#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, optional = nil) ⇒ RepresentationField
constructor
A new instance of RepresentationField.
Constructor Details
#initialize(name = nil, description = nil, required = nil, type = nil, elements_type = nil, optional = 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.
33 34 35 36 37 38 39 40 41 |
# File 'lib/angus/definitions/representation_field.rb', line 33 def initialize(name = nil, description = nil, required = nil, type = nil, elements_type = nil, optional = nil) self.name = name self.description = description self.required = required self.type = type self.elements_type = elements_type self.optional = optional end |
Instance Attribute Details
#description ⇒ String
Returns the description of the representation field.
10 11 12 |
# File 'lib/angus/definitions/representation_field.rb', line 10 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.
24 25 26 |
# File 'lib/angus/definitions/representation_field.rb', line 24 def elements_type @elements_type end |
#name ⇒ String
Returns the name of the representation field.
6 7 8 |
# File 'lib/angus/definitions/representation_field.rb', line 6 def name @name end |
#optional ⇒ Boolean
Returns true if the element is optional.
28 29 30 |
# File 'lib/angus/definitions/representation_field.rb', line 28 def optional @optional end |
#required ⇒ Boolean
Returns indicates if the representation field is required or not.
14 15 16 |
# File 'lib/angus/definitions/representation_field.rb', line 14 def required @required end |
#type ⇒ String
Returns the type of the representation field. This attribute is used when the representation is a single object.
19 20 21 |
# File 'lib/angus/definitions/representation_field.rb', line 19 def type @type end |
Instance Method Details
#==(other) ⇒ Boolean
Check if an object is equals to the current instance.
48 49 50 51 52 53 |
# File 'lib/angus/definitions/representation_field.rb', line 48 def ==(other) other.kind_of?(Definitions::RepresentationField) && name == other.name && description == other.description && required == other.required && type == other.type && elements_type == other.elements_type && optional == other.optional end |