Class: TezosClient::Tools::ConvertToHash::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/tezos_client/tools/convert_to_hash/base.rb

Direct Known Subclasses

Address, BigMap, Bytes, Int, Key, KeyHash, List, Map, Nat, Option, Pair, Set, Signature, String, Timestamp

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:, type:) ⇒ Base

Returns a new instance of Base.



7
8
9
10
# File 'lib/tezos_client/tools/convert_to_hash/base.rb', line 7

def initialize(data:, type:)
  @data = data
  @type = type
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



12
13
14
# File 'lib/tezos_client/tools/convert_to_hash/base.rb', line 12

def data
  @data
end

#typeObject

Returns the value of attribute type.



12
13
14
# File 'lib/tezos_client/tools/convert_to_hash/base.rb', line 12

def type
  @type
end

Instance Method Details

#valueObject



14
15
16
# File 'lib/tezos_client/tools/convert_to_hash/base.rb', line 14

def value
  anonymous? ? decode : { var_name => decode }
end