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.
-
#optional ⇒ Boolean
True if the element is optional.
-
#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, optional = 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, optional = nil) ⇒ RequestElement
Returns a new instance of RequestElement.
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/angus/definitions/request_element.rb', line 38 def initialize(name = nil, description = nil, required = nil, type = nil, constraints = nil, valid_values = nil, elements_type = nil, optional = 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 self.optional = optional if optional 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 |
#optional ⇒ Boolean
Returns true if the element is optional.
35 36 37 |
# File 'lib/angus/definitions/request_element.rb', line 35 def optional @optional 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.
55 56 57 58 59 60 61 62 |
# File 'lib/angus/definitions/request_element.rb', line 55 def ==(other) other.instance_of?(Definitions::RequestElement) && name == other.name && description == other.description && required == other.required && type == other.type && constraints == other.constraints && valid_values == other.valid_values && elements_type == other.elements_type && optional == other.optional end |