Class: SocketLabs::InjectionApi::Core::Serialization::MessageResultDto
- Inherits:
-
Object
- Object
- SocketLabs::InjectionApi::Core::Serialization::MessageResultDto
- Includes:
- SocketLabs::InjectionApi
- Defined in:
- lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb
Constant Summary
Constants included from SocketLabs::InjectionApi
Instance Attribute Summary collapse
-
#error_code ⇒ Object
Returns the value of attribute error_code.
-
#index ⇒ Object
Returns the value of attribute index.
Instance Method Summary collapse
-
#address_results ⇒ Array
Get the List of AddressResult objects.
-
#address_results=(value) ⇒ Object
Set the List of AddressResult objects.
-
#initialize ⇒ MessageResultDto
constructor
A new instance of MessageResultDto.
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ MessageResultDto
Returns a new instance of MessageResultDto.
14 15 16 17 18 |
# File 'lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb', line 14 def initialize @index = nil @error_code = nil @address_results = Array.new end |
Instance Attribute Details
#error_code ⇒ Object
Returns the value of attribute error_code.
12 13 14 |
# File 'lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb', line 12 def error_code @error_code end |
#index ⇒ Object
Returns the value of attribute index.
11 12 13 |
# File 'lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb', line 11 def index @index end |
Instance Method Details
#address_results ⇒ Array
Get the List of AddressResult objects
23 24 25 |
# File 'lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb', line 23 def address_results @address_results end |
#address_results=(value) ⇒ Object
Set the List of AddressResult objects
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb', line 29 def address_results=(value) @address_results = Array.new unless value.nil? if value.instance_of? Array value.each do |v1| if v1.instance_of? AddressResult @address_results.push(v1) end end end end end |
#to_hash ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb', line 46 def to_hash json = { :ErrorCode => @error_code, :Index => @index } if @address_results.length > 0 e = Array.new @address_results.each do |value| e.push(value.to_hash) end json[:AddressResult] = e end json end |