Sha256: 75122a74bbb242365328479153105a8990501ac391aa7184f30afdfe5ccee7b9

Contents?: true

Size: 540 Bytes

Versions: 48

Compression:

Stored size: 540 Bytes

Contents

require_relative 'abstract_command_handler'

class ArrayGetRankHandler < AbstractCommandHandler
  def initialize
    @required_parameters_count = 1
  end
  def process(command)
    begin
      if command.payload.length < @required_parameters_count
        raise ArgumentError.new "Array get rank parameters mismatch"
      end
      array = command.payload[0]
      rank = 0
      while array.is_a? Array
        rank = rank + 1
        array = array[0]
      end
      return rank
    rescue Exception => e
      return e
    end
  end
end

Version data entries

48 entries across 24 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.5.7 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.7 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.6 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.6 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.5 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.5 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.4 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.4 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.3 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.3 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.2 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.2 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.1 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.1 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.0 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.5.0 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.4.11 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.4.11 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.4.10 lib/javonet-ruby-sdk/Binaries/Ruby/Linux/X64/core/handler/array_get_rank_handler.rb
javonet-ruby-sdk-2.4.10 lib/javonet-ruby-sdk/Binaries/Ruby/MacOs/X64/core/handler/array_get_rank_handler.rb