Class: Angus::SDoc::Definitions::RequestElement
- Inherits:
-
Object
- Object
- Angus::SDoc::Definitions::RequestElement
- Defined in:
- lib/angus/definitions/request_element.rb
Instance Attribute Summary collapse
-
#constraints ⇒ Array<String>
The constraints of the request element.
-
#description ⇒ String
The description of the request element.
-
#elements_type ⇒ String
The elements type of the request element.
-
#name ⇒ String
The name of the request element.
-
#required ⇒ Boolean
Indicates if the request element is required or not.
-
#type ⇒ String
The type of the request element.
-
#valid_values ⇒ Array<String>
The valid values of the request element.
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, constraints = nil, valid_values = nil, elements_type = nil) ⇒ RequestElement
constructor
A new instance of RequestElement.
Constructor Details
#initialize(name = nil, description = nil, required = nil, type = nil, constraints = nil, valid_values = nil, elements_type = nil) ⇒ RequestElement
Returns a new instance of RequestElement.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/angus/definitions/request_element.rb', line 34 def initialize(name = nil, description = nil, required = nil, type = nil, constraints = nil, valid_values = nil, elements_type = nil) self.name= name if name self.description= description if description self.required= required if required self.type= type if type self.constraints= constraints if constraints self.valid_values= valid_values if valid_values self.elements_type= elements_type if elements_type end |
Instance Attribute Details
#constraints ⇒ Array<String>
Returns the constraints of the request element.
23 24 25 |
# File 'lib/angus/definitions/request_element.rb', line 23 def constraints @constraints end |
#description ⇒ String
Returns the description of the request element.
11 12 13 |
# File 'lib/angus/definitions/request_element.rb', line 11 def description @description end |
#elements_type ⇒ String
Returns the elements type of the request element.
31 32 33 |
# File 'lib/angus/definitions/request_element.rb', line 31 def elements_type @elements_type end |
#name ⇒ String
Returns the name of the request element.
7 8 9 |
# File 'lib/angus/definitions/request_element.rb', line 7 def name @name end |
#required ⇒ Boolean
Returns indicates if the request element is required or not.
15 16 17 |
# File 'lib/angus/definitions/request_element.rb', line 15 def required @required end |
#type ⇒ String
Returns the type of the request element.
19 20 21 |
# File 'lib/angus/definitions/request_element.rb', line 19 def type @type end |
#valid_values ⇒ Array<String>
Returns the valid values of the request element.
27 28 29 |
# File 'lib/angus/definitions/request_element.rb', line 27 def valid_values @valid_values end |
Instance Method Details
#==(other) ⇒ Boolean
Check if an object is equals to the current instance.
50 51 52 53 54 55 56 57 |
# File 'lib/angus/definitions/request_element.rb', line 50 def == (other) other.instance_of?(Definitions::RequestElement) && self.name == other.name && self.description == other.description && self.required == other.required && self.type == other.type && self.constraints == other.constraints && self.valid_values == other.valid_values && self.elements_type == other.elements_type end |