Class: Types::Typed::ContractType
- Defined in:
- lib/solidity/typed/metatypes/types.rb
Instance Attribute Summary collapse
-
#contract_type ⇒ Object
readonly
Returns the value of attribute contract_type.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #format ⇒ Object (also: #to_s)
-
#initialize(contract_type) ⇒ ContractType
constructor
note: assume for now contract_type is a (contract) class!!!!!.
- #mut? ⇒ Boolean
-
#new(initial_value) ⇒ Object
add support with passed in address - why? why not?.
Methods inherited from Type
#array?, #check_and_normalize_literal, #eql?, #hash, #mapping?, #parse_integer, #pretty_print, #raise_type_error, #zero
Constructor Details
#initialize(contract_type) ⇒ ContractType
note: assume for now contract_type is a (contract) class!!!!!
518 519 520 521 |
# File 'lib/solidity/typed/metatypes/types.rb', line 518 def initialize( contract_type ) raise ArgumentError, "[ContractType#initialize] class expected for contract_type arg" unless contract_type.is_a?( Class ) @contract_type = contract_type end |
Instance Attribute Details
#contract_type ⇒ Object (readonly)
Returns the value of attribute contract_type.
516 517 518 |
# File 'lib/solidity/typed/metatypes/types.rb', line 516 def contract_type @contract_type end |
Class Method Details
.instance(contract_type) ⇒ Object
510 511 512 513 514 |
# File 'lib/solidity/typed/metatypes/types.rb', line 510 def self.instance( contract_type ) raise ArgumentError, "[ContractType.insntance] class expected for contract_type arg" unless contract_type.is_a?( Class ) @instances ||= {} @instances[ contract_type.name ] ||= new( contract_type ) end |
Instance Method Details
#==(other) ⇒ Object
526 527 528 529 |
# File 'lib/solidity/typed/metatypes/types.rb', line 526 def ==(other) other.is_a?( ContractType ) && @contract_type == other.contract_type end |
#format ⇒ Object Also known as: to_s
523 |
# File 'lib/solidity/typed/metatypes/types.rb', line 523 def format() "contract(#{@contract_type.name})"; end |
#mut? ⇒ Boolean
532 |
# File 'lib/solidity/typed/metatypes/types.rb', line 532 def mut?() false; end |
#new(initial_value) ⇒ Object
add support with passed in address - why? why not?
534 535 536 |
# File 'lib/solidity/typed/metatypes/types.rb', line 534 def new( initial_value ) raise NameError, "no method create for ContractType; sorry" end |