Class: IRB::Statement::Expression

Inherits:
IRB::Statement show all
Defined in:
lib/irb/statement.rb

Instance Attribute Summary

Attributes inherited from IRB::Statement

#code

Instance Method Summary collapse

Constructor Details

#initialize(code, is_assignment) ⇒ Expression

Returns a new instance of Expression.



24
25
26
27
# File 'lib/irb/statement.rb', line 24

def initialize(code, is_assignment)
  @code = code
  @is_assignment = is_assignment
end

Instance Method Details

#evaluable_codeObject



41
42
43
# File 'lib/irb/statement.rb', line 41

def evaluable_code
  @code
end

#is_assignment?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/irb/statement.rb', line 37

def is_assignment?
  @is_assignment
end

#should_be_handled_by_debugger?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/irb/statement.rb', line 33

def should_be_handled_by_debugger?
  true
end

#suppresses_echo?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/irb/statement.rb', line 29

def suppresses_echo?
  @code.match?(/;\s*\z/)
end