Class: Types::Typed::StringType

Inherits:
ValueType show all
Defined in:
lib/solidity/typed/metatypes/types.rb

Overview

note: strings are frozen / immutable - check again!!

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Type

#array?, #check_and_normalize_literal, #eql?, #hash, #mapping?, #parse_integer, #pretty_print, #raise_type_error

Class Method Details

.instanceObject



120
# File 'lib/solidity/typed/metatypes/types.rb', line 120

def self.instance()  @instance ||= new; end

Instance Method Details

#==(other) ⇒ Object



126
# File 'lib/solidity/typed/metatypes/types.rb', line 126

def ==(other)  other.is_a?( StringType ); end

#formatObject Also known as: to_s



123
# File 'lib/solidity/typed/metatypes/types.rb', line 123

def format() 'string'; end

#mut?Boolean

Returns:

  • (Boolean)


134
# File 'lib/solidity/typed/metatypes/types.rb', line 134

def mut?()  false; end

#new(initial_value) ⇒ Object



137
# File 'lib/solidity/typed/metatypes/types.rb', line 137

def new( initial_value ) Types::String.new( initial_value ); end

#typedclassObject



132
# File 'lib/solidity/typed/metatypes/types.rb', line 132

def typedclass()       Types::String;  end

#typedclass_nameObject

note: use Types::String here to avoid confusion with ::String - why? why not? -fix-fix-fix- remove typedclass for “primitives” - used anywhere - why? why not?



131
# File 'lib/solidity/typed/metatypes/types.rb', line 131

def typedclass_name()  Types::String.name; end

#zeroObject Also known as: new_zero



135
# File 'lib/solidity/typed/metatypes/types.rb', line 135

def zero() Types::String.zero;  end