class TezosClient::Tools::HashToMicheline::Pair

Public Instance Methods

data_0() click to toggle source
# File lib/tezos_client/tools/hash_to_micheline/pair.rb, line 23
def data_0
  if data.is_a? ::Array
    data[0]
  else
    data
  end
end
data_1() click to toggle source
# File lib/tezos_client/tools/hash_to_micheline/pair.rb, line 31
def data_1
  if data.is_a? ::Array
    if data.size > 2
      data.drop(1)
    else
      data[1]
    end
  else
    data
  end
end
encode() click to toggle source
# File lib/tezos_client/tools/hash_to_micheline/pair.rb, line 7
def encode
  {
    prim: "Pair",
    args: [
      TezosClient::Tools::HashToMicheline::Base.new(
        data: data_0,
        type: type[:args][0]
      ).value,
      TezosClient::Tools::HashToMicheline::Base.new(
        data: data_1,
        type: type[:args][1]
      ).value
    ]
  }
end