Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/live/session.rb
Instance Method Summary collapse
-
#to_live_output ⇒ Object
Outputs an ANSI colored string with the object representation.
Instance Method Details
#to_live_output ⇒ Object
Outputs an ANSI colored string with the object representation
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/live/session.rb', line 32 def to_live_output case self when Exception "\e[41m\e[33m#{self.inspect}\e[0m" when Numeric, Symbol, TrueClass, FalseClass, NilClass "\e[35m#{self.inspect}\e[0m" when Notice "\e[42m\e[30m#{self}\e[0m" when Warning "\e[43m\e[30m#{self}\e[0m" when Special "\e[44m\e[37m#{self}\e[0m" when String "\e[32m#{self.inspect}\e[0m" when Array "[#{ self.collect{ |i| i.to_live_output}.join(', ') }]" when Hash "{#{ self.collect{ |i| i.collect{|e| e.to_live_output}.join(' => ') } }}" else "\e[36m#{self}\e[0m" end end |