Class: LibRubyParser::Nodes::Complex

Inherits:
LibRubyParser::Node show all
Defined in:
lib/lib-ruby-parser/nodes.rb

Overview

Represents a Complex literal (that returns an Complex number)

Instance Attribute Summary collapse

Instance Attribute Details

#expression_lLoc (readonly)

Location of the full expression

-1i
~~~

Returns:



774
775
776
# File 'lib/lib-ruby-parser/nodes.rb', line 774

def expression_l
  @expression_l
end

#operator_lLoc? (readonly)

Location of the - (but not +) operator. + is a part of the literal:

  1. +1i is String("+1i") with operator = None
  2. -1i is String("1i") with operator = String("-")
-1i
~

Returns:



765
766
767
# File 'lib/lib-ruby-parser/nodes.rb', line 765

def operator_l
  @operator_l
end

#valueString (readonly)

Value of the complex literal, returned as a String, String("1i") for 1i

Returns:

  • (String)


754
755
756
# File 'lib/lib-ruby-parser/nodes.rb', line 754

def value
  @value
end