Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/notroff/text.rb,
lib/notroff/string_extensions.rb

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



63
64
65
66
# File 'lib/notroff/text.rb', line 63

def ==(other)
  return self == other.string if other.kind_of?(Text)
  old_double_equals(other)
end

#indent_depthObject

Return the number of leading blanks



3
4
5
# File 'lib/notroff/string_extensions.rb', line 3

def indent_depth
  /^ */.match(self).to_s.size
end

#old_double_equalsObject



61
# File 'lib/notroff/text.rb', line 61

alias_method :old_double_equals, :'=='

#to_textObject



57
58
59
# File 'lib/notroff/text.rb', line 57

def to_text
  Text.new(self)
end