Class: String
Instance Method Summary collapse
- #colorize(color) ⇒ Object
- #enquote ⇒ Object
- #indent(spaces = 2) ⇒ Object
- #inline_dcm ⇒ Object
- #pastel ⇒ Object
- #present? ⇒ Boolean
Instance Method Details
#colorize(color) ⇒ Object
32 33 34 35 |
# File 'lib/core_ext.rb', line 32 def colorize(color) return self if false pastel.decorate(self, color) end |
#enquote ⇒ Object
24 25 26 |
# File 'lib/core_ext.rb', line 24 def enquote "\"#{to_s}\"" end |
#indent(spaces = 2) ⇒ Object
16 17 18 |
# File 'lib/core_ext.rb', line 16 def indent(spaces = 2) lines.map { |line| " " * spaces + line }.join end |
#inline_dcm ⇒ Object
20 21 22 |
# File 'lib/core_ext.rb', line 20 def inline_dcm "KONSERVIERUNG_FORMAT 2.0\n\n" + self end |
#pastel ⇒ Object
37 38 39 |
# File 'lib/core_ext.rb', line 37 def pastel @@pastel ||= Pastel.new end |
#present? ⇒ Boolean
28 29 30 |
# File 'lib/core_ext.rb', line 28 def present? !empty? end |