Class: Types::Typed::BoolType
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
.instance ⇒ Object
6
|
# File 'lib/solidity/typed/metatypes/bool.rb', line 6
def self.instance() @instance ||= new; end
|
Instance Method Details
#==(other) ⇒ Object
11
|
# File 'lib/solidity/typed/metatypes/bool.rb', line 11
def ==(other) other.is_a?( BoolType ); end
|
8
|
# File 'lib/solidity/typed/metatypes/bool.rb', line 8
def format() 'bool'; end
|
#mut? ⇒ Boolean
20
|
# File 'lib/solidity/typed/metatypes/bool.rb', line 20
def mut?() false; end
|
#new(initial_value) ⇒ Object
check - add default zero value - why? why not?
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/solidity/typed/metatypes/bool.rb', line 23
def new( initial_value ) if initial_value == true true
elsif initial_value == false false
else
raise ArgumentError, "BoolType.new - true or false arg expected; got: #{initial_value}"
end
end
|
#typedclass ⇒ Object
18
|
# File 'lib/solidity/typed/metatypes/bool.rb', line 18
def typedclass() Bool; end
|
#typedclass_name ⇒ Object
note: class is really a module for bool - hack!!!
remove class from methods (typedclass_name|typedclass) - why? why not?
change typedclass_name to typed_name !!!
and typedclass to typed !!! - why? why not??
17
|
# File 'lib/solidity/typed/metatypes/bool.rb', line 17
def typedclass_name() Bool.name; end
|
#zero ⇒ Object
Also known as:
new_zero
21
|
# File 'lib/solidity/typed/metatypes/bool.rb', line 21
def zero() Bool.zero; end
|