class Fixnum
def to_f
# …
end
endvede k
class String
def to_s
def to_str
def to_sym
def to_i
def to_d
def to_f
def to_a
def to_enum
def to_set
def to_param
def to_query
def to_json
def to_xs
def to_yaml
def to_yaml_proprties
def to_yaml_style
def to_blob
def to_date
def to_time
# …
endclass File
def initialize(file_path)
# …
end
end
File.new "/tmp"class Date
def self.from_string(a_string)
# …
Date.new # with the righ args
end
end
Date.from_string "2009-03-14"
Date.from_julian_string "-4712-03-01"Converter Constructor Method
