Class: InvocationContextIterator

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/javonet-ruby-sdk/sdk/internal/invocation_context_iterator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(array_as_invocation_context) ⇒ InvocationContextIterator

Returns a new instance of InvocationContextIterator.



7
8
9
10
11
12
13
14
15
# File 'lib/javonet-ruby-sdk/sdk/internal/invocation_context_iterator.rb', line 7

def initialize(array_as_invocation_context)
  @_array_as_invocation_context = array_as_invocation_context
  @position = -1
  @array_size = @_array_as_invocation_context.get_size.execute.get_value
  @array_as_list = Array.new(@array_size)
  @array_as_list.each_index do |i|
    @array_as_list[i] = _array_as_invocation_context.get_index(i)
  end
end

Instance Attribute Details

#_array_as_invocation_context=(value) ⇒ Object

Sets the attribute _array_as_invocation_context

Parameters:

  • value

    the value to set the attribute _array_as_invocation_context to.



4
5
6
# File 'lib/javonet-ruby-sdk/sdk/internal/invocation_context_iterator.rb', line 4

def _array_as_invocation_context=(value)
  @_array_as_invocation_context = value
end

Instance Method Details

#[](i) ⇒ Object



21
22
23
# File 'lib/javonet-ruby-sdk/sdk/internal/invocation_context_iterator.rb', line 21

def [](i)
  @_array_as_invocation_context.get_index(i)
end

#[]=(i, value) ⇒ Object



25
26
27
# File 'lib/javonet-ruby-sdk/sdk/internal/invocation_context_iterator.rb', line 25

def []=(i, value)
  @_array_as_invocation_context.set_index(i, value).execute
end

#each(&block) ⇒ Object



17
18
19
# File 'lib/javonet-ruby-sdk/sdk/internal/invocation_context_iterator.rb', line 17

def each(&block)
  @array_as_list.each(&block)
end