Method: IRB::Context#echo_on_assignment
- Defined in:
- lib/irb/context.rb
#echo_on_assignment ⇒ Object Also known as: echo_on_assignment?
Whether to echo for assignment expressions.
If set to false, the value of assignment will not be shown.
If set to true, the value of assignment will be shown.
If set to :truncate, the value of assignment will be shown and truncated.
It defaults to :truncate.
a = "omg"
#=> omg
a = "omg" * 10
#=> omgomgomgomgomgomgomg...
IRB.CurrentContext.echo_on_assignment = false
a = "omg"
IRB.CurrentContext.echo_on_assignment = true
a = "omg" * 10
#=> omgomgomgomgomgomgomgomgomgomg
To set the behaviour of showing on assignment in irb:
IRB.conf[:ECHO_ON_ASSIGNMENT] = :truncate or true or false
or
irb_context.echo_on_assignment = :truncate or true or false
or
IRB.CurrentContext.echo_on_assignment = :truncate or true or false
305 306 307 |
# File 'lib/irb/context.rb', line 305 def echo_on_assignment @echo_on_assignment end |