class SpaceAge

Definition of class SpaceAge for Exercism

Constants

EARTH_YEAR_IN_SECONDS
PLANETS

Public Class Methods

new(seconds) click to toggle source
# File lib/hack01/space_age.rb, line 16
def initialize(seconds)
  @seconds = seconds
end

Public Instance Methods

method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/hack01/space_age.rb, line 26
def method_missing(name, *args, &block)
  # first time using method_missing
  # super basically checks if the method exists in the class's ancestor
  # (if any)
  super
  raise "'#{name}' is not a method of the class #{self.class}"
end
respond_to_missing?(*) click to toggle source
# File lib/hack01/space_age.rb, line 34
def respond_to_missing?(*)
  p 'not sure what to do here but'
  p "rubocop recommends a 'respond_to_missing?' method"
end