Change in ovirt-engine-sdk-ruby[sdk_4.0]: Implement == and eql? for types
juan.hernandez at redhat.com
juan.hernandez at redhat.com
Tue Oct 18 09:32:33 UTC 2016
Juan Hernandez has submitted this change and it was merged.
Change subject: Implement == and eql? for types
......................................................................
Implement == and eql? for types
This patch changes the SDK so that struct types implement the '=='
operator and the 'eql?' methods comparing the values of the instance
variables. For example, the '==' operator generated for the
'ExternalVmImport' type is implemented like this:
#
# Returns `true` if `self` and `other` have the same attributes and
# values.
#
def ==(other)
super &&
@cluster == other.cluster &&
@cpu_profile == other.cpu_profile &&
@drivers_iso == other.drivers_iso &&
@host == other.host &&
@name == other.name &&
@password == other.password &&
@provider == other.provider &&
@quota == other.quota &&
@sparse == other.sparse &&
@storage_domain == other.storage_domain &&
@url == other.url &&
@username == other.username &&
@vm == other.vm
end
Change-Id: I945b79ba08fb9add2b47f862962d7487c1378868
Bug-Url: https://bugzilla.redhat.com/1383613
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
(cherry picked from commit 9022c3fae787221175f680939800f0176e564439)
---
M generator/src/main/java/org/ovirt/sdk/ruby/TypesGenerator.java
M sdk/lib/ovirtsdk4/type.rb
M sdk/spec/type_spec.rb
3 files changed, 225 insertions(+), 21 deletions(-)
Approvals:
Juan Hernandez: Verified; Looks good to me, approved
Jenkins CI: Passed CI tests
--
To view, visit https://gerrit.ovirt.org/65533
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I945b79ba08fb9add2b47f862962d7487c1378868
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-sdk-ruby
Gerrit-Branch: sdk_4.0
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
More information about the Engine-commits
mailing list