Module: Pythonism::Pythonize::Basic

Included in:
Array, FalseClass, Fixnum, NilClass, Object, String, TrueClass
Defined in:
lib/pythonism/pythonize/basic.rb

Overview

Provide Basic methods

Instance Method Summary collapse

Instance Method Details

#__class__Class

Returns:



25
26
27
# File 'lib/pythonism/pythonize/basic.rb', line 25

def __class__
  self.class
end

#__cmp__(other) ⇒ Fixnum

Returns:



55
56
57
# File 'lib/pythonism/pythonize/basic.rb', line 55

def __cmp__(other)
  self <=> other
end

#__eq__(other) ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/pythonism/pythonize/basic.rb', line 40

def __eq__(other)
  self == other
end

#__ge__(other) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/pythonism/pythonize/basic.rb', line 50

def __ge__(other)
  self >= other
end

#__gt__(other) ⇒ Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/pythonism/pythonize/basic.rb', line 45

def __gt__(other)
  self > other
end

#__le__(other) ⇒ Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/pythonism/pythonize/basic.rb', line 35

def __le__(other)
  self <= other
end

#__list__Array

Returns:



20
21
22
# File 'lib/pythonism/pythonize/basic.rb', line 20

def __list__
  to_a
end

#__lt__(other) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/pythonism/pythonize/basic.rb', line 30

def __lt__(other)
  self < other
end

#__ne__(other) ⇒ Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/pythonism/pythonize/basic.rb', line 60

def __ne__(other)
  self != (other)
end

#__new__(_object) ⇒ Object

Returns:

Raises:

  • (TypeError)


5
6
7
# File 'lib/pythonism/pythonize/basic.rb', line 5

def __new__(_object)
  raise TypeError
end

#__nonzero__Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/pythonism/pythonize/basic.rb', line 65

def __nonzero__
  true
end

#__repr__String

Returns:



15
16
17
# File 'lib/pythonism/pythonize/basic.rb', line 15

def __repr__
  inspect
end

#__str__String

Returns:



10
11
12
# File 'lib/pythonism/pythonize/basic.rb', line 10

def __str__
  to_s
end