Class: InvocationContextIterator
- Inherits:
-
Object
- Object
- InvocationContextIterator
- Includes:
- Enumerable
- Defined in:
- lib/javonet-ruby-sdk/sdk/internal/invocation_context_iterator.rb
Instance Attribute Summary collapse
-
#_array_as_invocation_context ⇒ Object
writeonly
Sets the attribute _array_as_invocation_context.
Instance Method Summary collapse
- #[](i) ⇒ Object
- #[]=(i, value) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(array_as_invocation_context) ⇒ InvocationContextIterator
constructor
A new instance of InvocationContextIterator.
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
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 |