SHARE
TWEET

Untitled

a guest Sep 17th, 2019 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Dog < Animal
  2.   attr_reader :weight
  3.  
  4.   def initialize(name, weight)
  5.     super(name)
  6.     @weight = weight
  7.   end
  8. end
  9.  
  10. fluffy = Dog.new('Fluffy', '5 lbs')
  11. puts fluffy.name # => 'Fluffy'
  12. puts fluffy.weight # => '5 lbs'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top