class TonSdk::Abi::AbiParam

Attributes

components[R]
name[R]
type_[R]

Public Class Methods

from_json(j) click to toggle source
# File lib/ton_sdk_client/abi.rb, line 383
def self.from_json(j)
  return nil if j.nil?

  comp_s = if j["components"].nil?
    []
  else
    j["components"].compact.map do |x|
      # TODO recursive parsing of AbiParam
      self.from_json(x)
    end
  end

  self.new(
    name: j["name"],
    type_: j["type"],
    components: comp_s
  )
end
new(name:, type_:, components: []) click to toggle source
# File lib/ton_sdk_client/abi.rb, line 365
def initialize(name:, type_:, components: [])
  @name = name
  @type_ = type_
  @components = components
end

Public Instance Methods

to_h() click to toggle source
# File lib/ton_sdk_client/abi.rb, line 371
def to_h
  cm_h_s = if !@components.nil?
    @components.compact.map(&:to_h)
  end

  {
    name: @name,
    type: @type_,
    components: cm_h_s
  }
end