Class: Angus::SDoc::Definitions::RequestElement

Inherits:
Object
  • Object
show all
Defined in:
lib/angus/definitions/request_element.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#constraintsArray<String>

Returns the constraints of the request element.

Returns:

  • (Array<String>)

    the constraints of the request element.



23
24
25
# File 'lib/angus/definitions/request_element.rb', line 23

def constraints
  @constraints
end

#descriptionString

Returns the description of the request element.

Returns:

  • (String)

    the description of the request element.



11
12
13
# File 'lib/angus/definitions/request_element.rb', line 11

def description
  @description
end

#elements_typeString

Returns the elements type of the request element.

Returns:

  • (String)

    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

#nameString

Returns the name of the request element.

Returns:

  • (String)

    the name of the request element.



7
8
9
# File 'lib/angus/definitions/request_element.rb', line 7

def name
  @name
end

#requiredBoolean

Returns indicates if the request element is required or not.

Returns:

  • (Boolean)

    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

#typeString

Returns the type of the request element.

Returns:

  • (String)

    the type of the request element.



19
20
21
# File 'lib/angus/definitions/request_element.rb', line 19

def type
  @type
end

#valid_valuesArray<String>

Returns the valid values of the request element.

Returns:

  • (Array<String>)

    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.

Parameters:

Returns:

  • (Boolean)

    true if all the attributes are equal and false otherwise.



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