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



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

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

Instance Method Details

#==(other) ⇒ Object



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

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

#formatObject Also known as: to_s



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

def format() 'string'; end

#mut?Boolean

Returns:

  • (Boolean)


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

def mut?()  false; end

#new(initial_value) ⇒ Object



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

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

#typedclassObject



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

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?



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

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

#zeroObject Also known as: new_zero



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

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