ovirt-engine-sdk 4.0.1 → 4.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,19 +15,17 @@
15
15
  #
16
16
 
17
17
  module OvirtSDK4
18
-
19
18
  #
20
19
  # This module is a mixin that contains the methods common to struct and list types.
21
20
  #
22
21
  module Type
23
-
24
22
  #
25
23
  # Returns the value of the `href` attribute.
26
24
  #
27
25
  # @return [String]
28
26
  #
29
27
  def href
30
- return @href
28
+ @href
31
29
  end
32
30
 
33
31
  #
@@ -86,13 +84,12 @@ module OvirtSDK4
86
84
  elsif key.is_a?(Integer)
87
85
  current = current[key]
88
86
  else
89
- raise TypeError.new("The key '#{key}' isn't a symbol or integer")
87
+ raise TypeError, "The key '#{key}' isn't a symbol or integer"
90
88
  end
91
89
  break if current.nil?
92
90
  end
93
91
  current
94
92
  end
95
-
96
93
  end
97
94
 
98
95
  #
@@ -108,6 +105,24 @@ module OvirtSDK4
108
105
  self.href = opts[:href]
109
106
  end
110
107
 
108
+ #
109
+ # Returns `true` if `self` and `other` have the same attributes and values.
110
+ #
111
+ def ==(other)
112
+ !other.nil? && self.class == other.class
113
+ end
114
+
115
+ #
116
+ # Use the same logic for `eql?` and `==`.
117
+ #
118
+ alias eql? ==
119
+
120
+ #
121
+ # Generates a hash value for this object.
122
+ #
123
+ def hash
124
+ 0
125
+ end
111
126
  end
112
127
 
113
128
  #
@@ -116,5 +131,4 @@ module OvirtSDK4
116
131
  class List < Array
117
132
  include Type
118
133
  end
119
-
120
134
  end