Class: TEALrb::OpcodeType

Inherits:
Object
  • Object
show all
Defined in:
lib/tealrb/opcode_type.rb

Direct Known Subclasses

Account, App, AppArgs, Asset, GroupTxn, Logs, ThisTxn

Instance Method Summary collapse

Constructor Details

#initialize(contract) ⇒ OpcodeType

Returns a new instance of OpcodeType.



17
18
19
# File 'lib/tealrb/opcode_type.rb', line 17

def initialize(contract)
  @contract = contract
end

Instance Method Details

#[](index) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/tealrb/opcode_type.rb', line 21

def [](index)
  if index.is_a?(Integer)
    @contract.txna @field, index
  else
    @contract.txnas @field
  end

  self
end