Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/string.rb

Instance Method Summary collapse

Instance Method Details

#force_encoding(enc) ⇒ Object


7
8
9
# File 'lib/string.rb', line 7

def force_encoding(enc)
  self
end

#is_binary_data?Boolean

Returns:

  • (Boolean)

2
3
4
# File 'lib/string.rb', line 2

def is_binary_data?
  self.count( "^ -~", "^\r\n" ).fdiv(self.size) > 0.3 || self.index( "\x00" )
end