Sha256: 36b5864fc0d0bf753e905ce18483765b9fba515811f6a35e012f604596edd255

Contents?: true

Size: 1.53 KB

Versions: 8

Compression:

Stored size: 1.53 KB

Contents

require_relative '../../address_result.rb'

module SocketLabs
  module InjectionApi
    module Core
      module Serialization

        class MessageResultDto
          include SocketLabs::InjectionApi

          attr_accessor :index
          attr_accessor :error_code

          def initialize
            @index = nil
            @error_code = nil
            @address_results = Array.new
          end

            
          # Get the List of AddressResult objects
          # @return [Array]
          def address_results 
            @address_results
          end
          
          # Set the List of AddressResult objects
          # @param [Array] value
          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


          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

        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
socketlabs-injectionapi-1.4.4 lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb
socketlabs-injectionapi-1.4.3 lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb
socketlabs-injectionapi-1.4.2 lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb
socketlabs-injectionapi-1.4.0 lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb
socketlabs-injectionapi-1.2.1 lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb
socketlabs-injectionapi-1.1.0 lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb
socketlabs-injectionapi-1.0.1 lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb
socketlabs-injectionapi-0.0.1.pre.Dev lib/socketlabs/injectionapi/core/serialization/message_result_dto.rb