What are we supposed to try in IRB? (class extensions question)


Remember that in Ruby, everything is an object, even a number. Try this in irb:
>> 4.class => Fixnum >> 4.methods ["inspect", "%", "<<", ...

So… it just trails off? I am not sure what I am supposed to type to complete this. Anyone figure this out?

Oh! figured it out. It’s another thing that needs a line break.

    irb(main):002:0> 4.class
    => Fixnum
    irb(main):003:0> 4.methods
    => [:%, :&, :*, :+, :-, :/, :<, :>, :^, :|, :~, :-@, :**,  :<=>, :<<, :>>, :<=, :>=, :==, :===, 
    :[], :inspect, :size, :succ, :to_s, :to_f, :div, :divmod, :fdiv, :modulo, :abs, :magnitude,
     :zero?, :odd?, :even?, :bit_length, :to_int, :to_i, :next, :upto, :chr, :ord, :integer?, 
    :floor, :ceil, :round, :truncate, :downto, :times, :pred, :to_r, :numerator, :denominator, 
    :rationalize, :gcd, :lcm, :gcdlcm, :+@, :eql?, :singleton_method_added, :coerce, :i,
     :remainder, :real?, :nonzero?, :step, :positive?, :negative?, :quo, :arg, :rectangular,
     :rect, :polar, :real, :imaginary, :imag, :abs2, :angle, :phase, :conjugate, :conj, :to_c,
     :between?, :instance_of?, :public_send, :instance_variable_get, 
     :instance_variable_set, :instance_variable_defined?, :remove_instance_variable, 
     :private_methods, :kind_of?, :instance_variables, :tap, :is_a?, :extend,
    :define_singleton_method, :to_enum, 
    :enum_for, :=~, :!~, :respond_to?, :freeze, :display, :send, :object_id, :method, 
    :public_method, :singleton_method, :nil?, :hash, :class, :singleton_class, :clone, 
    :dup, :itself, :taint, :tainted?, :untaint, :untrust, :trust, :untrusted?, :methods, 
    :protected_methods, :frozen?, :public_methods, :singleton_methods, :!, :!=, 
    :__send__, :equal?, :instance_eval, :instance_exec, :__id__]

Got it. Thanks again!