Class: String

Inherits:
Object show all
Includes:
Pythonism::Pythonize::Basic, Pythonism::Pythonize::Numeric
Defined in:
lib/pythonism/classes/string.rb

Overview

Pythonized String class

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Pythonism::Pythonize::Numeric

#__add__, #__and__, #__float__, #__hex__, #__int__, #__long__, #__mod__, #__mul__, #__oct__, #__or__, #__sub__, #__xor__

Methods included from Pythonism::Pythonize::Basic

#__class__, #__cmp__, #__eq__, #__ge__, #__gt__, #__le__, #__list__, #__lt__, #__ne__, #__new__, #__repr__, #__str__

Class Method Details

.to_sString

Returns:



20
21
22
# File 'lib/pythonism/classes/string.rb', line 20

def self.to_s
  'str'
end

Instance Method Details

#__nonzero__Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/pythonism/classes/string.rb', line 10

def __nonzero__
  size != 0
end

#to_aArray

Returns:



15
16
17
# File 'lib/pythonism/classes/string.rb', line 15

def to_a
  each_char.to_a
end