class Basic101::BasicObject

Public Class Methods

type_name() click to toggle source
# File lib/basic101/basic_object.rb, line 7
def self.type_name
  name.split('::').last.gsub(/^Basic/, '').downcase
end

Public Instance Methods

eval(runtime) click to toggle source
# File lib/basic101/basic_object.rb, line 15
def eval(runtime)
  self
end
to_float() click to toggle source
# File lib/basic101/basic_object.rb, line 27
def to_float
  raise TypeError, "#{type_name} cannot be converted to float"
end
to_integer() click to toggle source
# File lib/basic101/basic_object.rb, line 23
def to_integer
  raise TypeError, "#{type_name} cannot be converted to integer"
end
to_numeric() click to toggle source
# File lib/basic101/basic_object.rb, line 19
def to_numeric
  raise TypeError, "#{type_name} cannot be converted to numeric"
end
to_string() click to toggle source
# File lib/basic101/basic_object.rb, line 31
def to_string
  raise TypeError, "#{type_name} cannot be converted to string"
end
type_name() click to toggle source
# File lib/basic101/basic_object.rb, line 11
def type_name
  self.class.type_name
end